Table row definition
Table row definition
ElliotReevey
Posts: 3Questions: 0Answers: 0
So I have the following code which works:
[code]
var a = $("#sample_1").dataTable().fnAddData( [
domEle['AGENCY_NAME'],
domEle['ADVERTISER_NAME'],
domEle['CAMPAIGN_NAME'],
domEle['STRATEGY_NAME'],
domEle['IMPRESSIONS'],
domEle['CLICKS'],
domEle['PC_CONVERSIONS'],
domEle['PV_CONVERSIONS'],
domEle['ADJ_PV_CONVERSIONS'],
domEle['eCPM'],
domEle['eCPA'],
domEle['eCPC'],
domEle['MEDIA_COST'],
domEle['TOTAL_SPEND'],
]);
[/code]
However I want to display the columns in the order which is returned in AJAX so I want to change it to this:
[code]
var a = $("#sample_1").dataTable().fnAddData( [
$.each(data['columns_order'], function(key, value){
domEle[data['columns_order'][key]['fieldy']],
});
]);
[/code]
But I keep getting the following error "Uncaught SyntaxError: Unexpected token ) ", can anyone help?
Cheers
[code]
var a = $("#sample_1").dataTable().fnAddData( [
domEle['AGENCY_NAME'],
domEle['ADVERTISER_NAME'],
domEle['CAMPAIGN_NAME'],
domEle['STRATEGY_NAME'],
domEle['IMPRESSIONS'],
domEle['CLICKS'],
domEle['PC_CONVERSIONS'],
domEle['PV_CONVERSIONS'],
domEle['ADJ_PV_CONVERSIONS'],
domEle['eCPM'],
domEle['eCPA'],
domEle['eCPC'],
domEle['MEDIA_COST'],
domEle['TOTAL_SPEND'],
]);
[/code]
However I want to display the columns in the order which is returned in AJAX so I want to change it to this:
[code]
var a = $("#sample_1").dataTable().fnAddData( [
$.each(data['columns_order'], function(key, value){
domEle[data['columns_order'][key]['fieldy']],
});
]);
[/code]
But I keep getting the following error "Uncaught SyntaxError: Unexpected token ) ", can anyone help?
Cheers
This discussion has been closed.