$(document).ready(function() { $('#example').datatable( { //"ajax": "jsonarray.txt", "ajax" :{ "url" : "jsonarray.txt", "datasrc" :"caselist" }, "columns": [ { "data": "caseid" }, { "data": "accountid" }, { "data": "createdby" }, { "data": "casecreationdate" }, { "data": "serialno" }, { "data": "productline" }, { "data": "casestatus" }, { "data": "description" } ], "fnrowcallback": function( nrow, adata, idisplayindex ) { var addbutton = '<a name="caseid" data-plname="'+adata["plshortname"]+'" data-caseid="'+adata["caseid"]+'" class="caseno">'+adata["caseid"]+'</a>'; $('td:eq(0)', nrow).html(addbutton); } } ); } );
this, piece of code have written data table,its not working me..kindly tell me problem is. , right way write code.
you cant not directly write ajax
call instead use datatable
"sajaxsource": url
attribute, or use osettings.jqxhr
write custom ajax call
osettings.jqxhr = $.ajax({ "datatype": 'json', "type": "post", "url": ssource, "data": aodata, "success": fncallback });
Comments
Post a Comment