How to filter data retrieved from AjaxSource or SQL?
How to filter data retrieved from AjaxSource or SQL?
I can filter data from a table written in HTML,
[code]
[/code]
But I have trouble in filtering the mData, pulled from a db. It just won't work.
[code]
$(document).ready(function() {
var table = $("#loggerTable").dataTable({
"sUpdateURL": "message.php",
"sPaginationType": "full_numbers",
"sAjaxSource" : "controller/message.php",
"bJQueryUI": true,
"bFilter": true,
"bDestroy": true,
"bAutoWidth": false,
"aoColumns": [
{ "mData": "messageid" },
{ "mData": "received" },
{ "mData": "instancename" },
{ "mData": "channelname" },
{ "mData": "physicaladdress" },
{ "mData": "type" },
{ "mData": "source" },
{ "mData": "id" },
{ "mData": "destination" },
{ "mData": "body" }
],
});
$("#loggerTable").dataTable.columnFilter({"aoColumns": [
{ type: "text"},
{ type: "text"},
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" }
],
});
});
Thanks!
[/code]
[code]
[/code]
But I have trouble in filtering the mData, pulled from a db. It just won't work.
[code]
$(document).ready(function() {
var table = $("#loggerTable").dataTable({
"sUpdateURL": "message.php",
"sPaginationType": "full_numbers",
"sAjaxSource" : "controller/message.php",
"bJQueryUI": true,
"bFilter": true,
"bDestroy": true,
"bAutoWidth": false,
"aoColumns": [
{ "mData": "messageid" },
{ "mData": "received" },
{ "mData": "instancename" },
{ "mData": "channelname" },
{ "mData": "physicaladdress" },
{ "mData": "type" },
{ "mData": "source" },
{ "mData": "id" },
{ "mData": "destination" },
{ "mData": "body" }
],
});
$("#loggerTable").dataTable.columnFilter({"aoColumns": [
{ type: "text"},
{ type: "text"},
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" }
],
});
});
Thanks!
[/code]
This discussion has been closed.