$('#trading_positions_table').dataTable({
"sDom": '<"top"i>rt<"pos_links"><"bottom"p><"clear">',
"aoColumns":[
{"sType": "string"},
{"sType": "numeric-comma"},
{"sType": "numeric-comma"},
{"sType": "numeric-comma"},
{"sType": "numeric-comma"},
{"sType": "numeric-comma"},
{"sType": "numeric-comma"},
{"sType": "numeric-comma"},
{"sType": "numeric-comma"},
{"sType": "string"},
{"sType": "numeric-comma"},
{"sType": "string"},
{"sType": "numeric-comma"}
],
"sPaginationType": "full_numbers",
"bPaginate": true,
"aLengthMenu": [[10, 25, 50,100, -1], [10, 25, 50,100, "All"]],
"aaSorting":[],
"bFilter": false,
"bInfo":true,
"bAutoWidth": true,
"bSortClasses": false,
"iDisplayLength": 250,
"sScrollY":"275px",
"sScrollX":"100%",
"bProcessing":true,
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
//decorateTradingPosRow(nRow);
return nRow;
},
"oLanguage":{
"sZeroRecords": "No positions",
"sEmptyTable": "No positions"
}
});
<table cellspacing="0" style="width:100%" class="dataTable" id="trading_positions_table">
<thead>
<tr>
<%
int i = 0;
for (String col : tradingPositionColumns) {
if (i==0 || i==9 || i == 11 || i == 1) {
%> <th><span style="white-space:nowrap;"><%=col%></span></th>
<%
} else {
%>
<th class="right"><span style="white-space:nowrap;"><%=col%></span></th>
<%
}
%>
<% i++; }
%>
</tr>
</thead>
<tbody id="trading_positions_table_body">
</tbody>
</table>
nScrollHeadInner.style.width = _fnStringToCss( $(o.nTable).outerWidth()+o.oScroll.iBarWidth );
nScrollHeadInner.style.width = _fnStringToCss( $(o.nTable).outerWidth()+o.oScroll.iBarWidth );
"aoColumns": [
{
"sWidth": "10%",
"fnRender": function (oObj) {
return function_name1(oObj.aData[0]);
}
},
{
"fnRender": function (oObj) {
return function_name2(oObj.aData[1]);
}
},
{
"fnRender": function (oObj) {
return function_name3(oObj.aData[0],oObj.aData[2]);
}
}]
"aoColumns": [
{
"sWidth": "10%",
"fnRender": function (oObj) {
col0 = oObj.aData[0];
return function_name1(oObj.aData[0]);
}
},
{
"fnRender": function (oObj) {
return function_name2(oObj.aData[1]);
}
},
{
"fnRender": function (oObj) {
return function_name3(col0,oObj.aData[2]);
}
}]
Since the functions will execute sequentially this should work okay.It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.