Prefiltering a column while using serverside
Prefiltering a column while using serverside
Im retrieving all my data serverside. It needs to be filtered serverside, not through the fnFilter method. This is because the table needs to only reflect the log of a specific user:
* id_log
* id_user < this needs to be filtered by ID, e.g.: 45
* date
* description
Of course, If I use the fnFilter approach, a smart guy could hack the javascript call to display other user's log. So, that's insecure.
[code]
oTable.fnFilter(1, 87);
//insecure mode
[/code]
Now, I could probably have all the data prefiltered in a php array, and then dumped in the dataTable with aaData, but this example has tens of thousands of records, and the parsing can become really slow.
So, (using full serverside approach) how could I pre-filter a column on the serverside?
* id_log
* id_user < this needs to be filtered by ID, e.g.: 45
* date
* description
Of course, If I use the fnFilter approach, a smart guy could hack the javascript call to display other user's log. So, that's insecure.
[code]
oTable.fnFilter(1, 87);
//insecure mode
[/code]
Now, I could probably have all the data prefiltered in a php array, and then dumped in the dataTable with aaData, but this example has tens of thousands of records, and the parsing can become really slow.
So, (using full serverside approach) how could I pre-filter a column on the serverside?
This discussion has been closed.
Replies
[code]
"fnServerParams": function ( aoData ) {
aoData.push({
"name": "prefilter", "value": "<?=base64_encode(serialize($where))?>"
});
}
[/code]
Where $where contains the sql WHERE clauses that need to be applied in the sAjaxSource.