Ajax DataGrid Support Product Page
This topic was archived
Link to grid w/pre defined filter?
Asked 23 Jan 2009 23:40:17
1
has this question
23 Jan 2009 23:40:17 brad baker posted:
I need to create navigation with links to a grid with predefined filters. This code below works just fine but its only useful if your already on the grid page. I need it to link directly to the page itself and set the filters.<li><a href="#" onclick="controlAjaxDataGrid(document, 'dmx_grid4', 'setFilter', 'custom', 'bpefiledpt_id', '=', '<?php echo $row_master1bpe_filedpts['bpefiledpt_id']; ?>')"><?php echo KT_FormatForList($row_master1bpe_filedpts['bpefiledpt_name'],15); ?></a></li>
Replies
Replied 24 Jan 2009 01:31:46
24 Jan 2009 01:31:46 Jim Varrone replied:
I need to do the same thing.
Replied 24 Jan 2009 14:24:38
24 Jan 2009 14:24:38 George Petrov replied:
Hi Brad - maybe you can add the control Ajax grid behavior on the page onload event and have it filter accoring a passed query string parameter?
Greetings,
George
--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFiles.nl
--------------------------------------------------
Greetings,
George
--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFiles.nl
--------------------------------------------------
Replied 24 Jan 2009 15:51:03
24 Jan 2009 15:51:03 Jim Varrone replied:
The "passed query string" can only contain one filter, correct? In my case I need to pass multiple filters, such as "WHERE status='OK' AND email <> '' AND code = 1' The status, email and code need to be selected by the user then passed to the grid.
How can this be done?
How can this be done?
Replied 26 Jan 2009 17:57:46
26 Jan 2009 17:57:46 brad baker replied:
This doesnt work as it appears that grid needs to load first or someting, but if I add a button with the same control it will filter.
what file is the control js code in?
what file is the control js code in?
Replied 26 Jan 2009 18:32:55
26 Jan 2009 18:32:55 brad baker replied:
Okay what I had to do was
1. In your navigation make it so its grid_page.php?filter=<your filter>&value=<your value>
2. make a new JS function on the page
3. add an onload function that has a settimeout to 1000
This will then apply the filter.
1. In your navigation make it so its grid_page.php?filter=<your filter>&value=<your value>
2. make a new JS function on the page
function updategrid()
{
controlAjaxDataGrid(document, 'dmx_grid4', 'setFilter', 'custom', '<?php echo $_GET['filter']; ?>', '=', '<?php echo $_GET['value']; ?>');
}
3. add an onload function that has a settimeout to 1000
<body onload="setTimeout('updategrid()',1000)">
This will then apply the filter.
