Jquery Ajax issue
Jquery Ajax issue
shafiqkr
Posts: 23Questions: 0Answers: 0
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
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
This discussion has been closed.
Replies
So having that that, where is your DataTables initialisation? There is no call to $().dataTable() in the above code.
Allan
also i do have image folder but stil not working