Using fnfilter and global search
Using fnfilter and global search
Hi,
fnFilter is working fine, but i am not able to use the basic global search anymore.
I provide the ability to my users to make a subselection on the data.
From this subselection, i got a list of ids that i put into fnfilter like this :
[code]
var tab=<?php echo htmlspecialchars(json_encode($_POST['idList']), ENT_NOQUOTES); ?>;
oTable.fnFilter(tab.join(","), 0);
[/code]
So tab looks like ["620","754","1283"], and fnFilter is getting a string like 620,754,1283.
I have modified server_processing.php to fit my data for fnFilter :
[code]
/* Individual column filtering */
for ( $i=0 ; $i
fnFilter is working fine, but i am not able to use the basic global search anymore.
I provide the ability to my users to make a subselection on the data.
From this subselection, i got a list of ids that i put into fnfilter like this :
[code]
var tab=<?php echo htmlspecialchars(json_encode($_POST['idList']), ENT_NOQUOTES); ?>;
oTable.fnFilter(tab.join(","), 0);
[/code]
So tab looks like ["620","754","1283"], and fnFilter is getting a string like 620,754,1283.
I have modified server_processing.php to fit my data for fnFilter :
[code]
/* Individual column filtering */
for ( $i=0 ; $i
This discussion has been closed.
Replies
[code]oTable.fnFilter(tab.join(","), 0)[/code]
to
[code]oTable.fnFilter(tab, 0, false,true,true,true);[/code]
and
[code]
$arr = explode(",",$_GET['sSearch_'.$i]);
$sWhere .= " ( ";
for ( $i=0 ; $i
Is there a size limit somewhere (fnfilter) ?
I can email debug link to interested people.
Thanks
Allan
The $sWhere is empty when there's a lot of row.
To be sure, i bypassed the search and the filtering code, and put [code] id = ANY(ARRAY[".$_GET['sSearch_0]."])[/code] in $sQuery before calling pg_query.
sSearch_0 contains the ids (checked in firebug), but $sSearch_0 is empty in $sQuery.
Also, I tried to use fnserverparams to pass ids in another way than fnfilter, like this :
[code]
oTable = $('#example').dataTable( {
...
"fnServerParams": function ( aoData ) {
/* Add some extra data to the sender */
aoData.push( { "name": "id", "value": tab } )
}
...
});
[/code]
where tab is 1,2,3,4...
In firebug, i see that GET request to server_processing.php contain id=1,2,3,4
But in my php script on server side, there is no $_GET['id'] set.
Am I getting fnServerParams data the right way with $_GET['id'] ?