Assign ID to datatable row from json data

NatVox

New Member
i'm new to datatable jquery plugin.I got stuck with this for more than 2 days. I have a Json Data, i still cant load the table and i also want to assign first column to be id of the row Here is html:\[code\]<table cellpadding="0" cellspacing="0" border="0" class="display" id="accDetailTable"> <thead> <tr> <th>Currency</th> <th>Current/Savings Account No.</th> <th>Securities Account No.</th> </tr> </thead> <tbody> </tbody></table>\[/code\]and my initialization\[code\]var oTable=$('#accDetailTable').dataTable( { "bProcessing": true, "bServerSide": true, "sAjaxSource": contextPath + "/user/investorAjax?method=getInvestorAccDetailList", "iDeferLoading": 57, } );\[/code\]Return jsonData from server :\[code\] {"sEcho":1,"iColumns":4,"iTotalRecords":16,"iTotalDisplayRecords":16,"aaData": [{"DT_RowId":2032,"currency":1,"currentAccNo":"aa","secureAccNo":"aa"}, {"DT_RowId":2033,"currency":1,"currentAccNo":"111","secureAccNo":"111"}, {"DT_RowId":2034,"currency":1,"currentAccNo":"a","secureAccNo":"aa"}, ]}}\[/code\]But it always hit :\[quote\] DataTables warning (table id = 'accDetailTable'): Added data (size undefined) does not match known number of columns (3)\[/quote\]
 
Top