Why is my table contain no row when it suppose to have 3 rows.

Why is my table contain no row when it suppose to have 3 rows.

rockcowrockcow Posts: 4Questions: 2Answers: 0
edited October 2014 in Free community support

I know my table should have 3 row but table only display message "processing". http://debug.datatables.net/oyoyog,

here is what ajax return
[{"name":"Autumn M. Andy;41","email":" ","phone":" ","city":"Phoenix","state":"Arizona","skill":"Customer Service"},{"name":"Y. Nelson Tom;518","email":" ","phone":" ","city":"Phoenix","state":"Arizona","skill":"Customer Service"},{"name":"shirrey Y. Wang;52","email":" ","phone":" ","city":"Phoenix","state":"Arizona","skill":"Customer Service"}]

Here is code in question

//setup and populate table function get_selected_people() { $.ajax({ url: "ajax_search_by_skill_city_state", type: "POST", data: { 'skill_id' : $("#skill_select option:selected").val(), 'city_id' : $("#city_select option:selected").val(), 'state_id' : $("#state_select option:selected").val() }, dataType: "json", success: function(data){ //alert(data); //var opts = $.parseJSON(data); if(data) { //$("body").html(data); aDataSet = data; } } }); if (oTable) { oTable.fnDestroy(); } $(document).ready(function() { $('#tabContent').html( '
' ); oTable = $('#mytable').dataTable( { 'iDisplayLength' : 10, 'bStateSave': true, // Save the state in cookies 'iCookieDuration' : 43200 // good for 12 hours ,"aaData" : aDataSet ,"bProcessing" : true ,"aoColumns": [ { "sTitle": "Name", "data":"name"} ,{ "sTitle": "Email", "sClass": "right", "data":"email"} ,{ "sTitle": "Phone","data":"phone"} ,{ "sTitle": "City", "data":"city"} ,{ "sTitle": "State", "data":"state"} ,{ "sTitle": "Skills", "data":"skill"} ] ,"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull) { var words = new Array(); words=aData[0].split(";"); $('td:eq(0)', nRow).html( words[0] ); $(nRow).attr("id", words[words.length-1]); return nRow; } ,"sDom": 'T<"clear">lfrtip' ,"oTableTools": { "sSwfPath": "/VZAdmin/js/datatables/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf" ,"sRowSelect": "single" } }) }) oTable.fnDraw(); }

Answers

  • rockcowrockcow Posts: 4Questions: 2Answers: 0

    I made a mistake. datatable version I am using is 1.9.0 as someone pointed out in another question I have. in 1.9.0 I should use mDataProp not mData nor data.
    Thank you very much for reviewing my question.

This discussion has been closed.