Closed lexfernandez closed 9 years ago
This is my code:
I include the libraries:
and then I created the datatable like this:
$('#MyTable').datatable({ data: filterList, pageSize: itemsPerPage, sort:'*', lineFormat: function (id, data) { var res = $('<tr></tr>'); for (var key in data) { if (key != "GroupId" && key != "GroupName" && key != "Number") if(key==="Name") res.append('<td><a href="/Project/Details/'+ data['Id'] +'">' + data[key] + '</a></td>'); else res.append('<td>' + data[key] + '</td>'); } $(res).attr('id', data['Id']); $(res).dblclick(function () { window.location.href = "/Project/Details/" + $(this).attr('id'); }); return res; }, pagingDivSelector: '#projectPaging', pagingNumberOfPages: 10 });
Can you please tell me what am I doing wrong? the datable is created and the arrows to sort the table are shown but when you click on it it just do nothing.
Thanks, Alex Fernandez
Forget about it I just needed to add the data-sort="key" with the key to the table header column to be sorted.
Thanks
This is my code:
I include the libraries:
and then I created the datatable like this:
Can you please tell me what am I doing wrong? the datable is created and the arrows to sort the table are shown but when you click on it it just do nothing.
Thanks, Alex Fernandez