Jquery Ajax issue

Jquery Ajax issue

shafiqkrshafiqkr Posts: 23Questions: 0Answers: 0
edited December 2011 in DataTables 1.8
Hi all,
when i am creating table like below,then datatable pagination is not working
$.ajax({
type: 'POST',
url: 'CompanyList.aspx/GetCompanyList',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (msg) {
var div = $('#table_id').empty().append('IDCOMPANY' +
'ADDRESSEditDelete');
//loop each record
for (var i = 0; i < msg.d.length; i++) {

div.append('' + msg.d[i].ID + '' +
'' + msg.d[i].COMPANY + '' + msg.d[i].ADDRESS + '' +
'Edit' +
'Delete');
}
div.append('');

}
});
HTML is
BUT
but when i am puting this tml hardcoded then it is working
IDCOMPANYADDRESSEditDelete390032newssaddEditDelete390031eejjjEditDelete390029NameaddressEditDelete390019testingaddressEditDelete390018testingaddressEditDelete

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Please don't post the same question multiple times. it just means that myself and the others who give up their time to help on the forum have less time to provide answers, since we need to filter through more threads.

    So having that that, where is your DataTables initialisation? There is no call to $().dataTable() in the above code.

    Allan
  • shafiqkrshafiqkr Posts: 23Questions: 0Answers: 0
    edited December 2011
    OK...i sort out the issue.Now i can not apply css.how it could be?i have these lines at the top



    also i do have image folder but stil not working
This discussion has been closed.