Categories | Question details Back To List | ||
Custom Filtering Hi guys, i have a grid with some filtering options specified. I also have created a grid footer with a couple of customised search fields (selecting between two dates for instance). Each of these currently works independently, howeverI want to be able to use them in unison, i.e. select to display a set of results between two dates and then filter tha from the filter bar on the grid, but I can't figure out how to do this? heres the grid crewPrevGrid = crewTabbar.cells("crewprev").attachGrid(); crewPrevGrid.setImagePath('codebase/imgs/'); crewPrevGrid.setHeader('Date,Client,Job,Callout,Task,Location,Start,Hrs,Rate,Cost,Status,Late,View'); crewPrevGrid.attachFooter("Totals,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,<div id='sumcrewcost'>Cost</div>,#cspan,#cspan,#cspan"); crewPrevGrid.attachHeader("Filter,#select_filter,#select_filter,#select_filter,#select_filter, , , , , ,#select_filter, ,#select_filter"); crewPrevGrid.attachFooter("<label class='headerlbls'>Filter dates from</label><input type='text' id='dateStartFilt' class='headertxt' onchange=\"dateFilter();\"><label class='headerlbls'>to</label><input type='text' id='dateEndFilt' class='headertxt'>,#cspan,#cspan,#cspan,#cspan,#cspan,<a href=\"#\" onClick=\"crewReport()\"><img src='images/printer.png' style='display:block;margin-top:2px;border:none;'></a>,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan"); the grid is loaded like this crewPrevGrid.clearAndLoad("crewdetail.php?action=crewprevious&CrewID=" + crewid, postCrewLoad); On a date change in the footer I call this.. function dateFilter() { crewPrevGrid.clearAndLoad("crewdetail.php?action=crewprevious&CrewID=" + (CrewTree.getSelectedItemId()).substr(2) + "&datefrom=" + $('dateStartFilt').value + "&dateto=" + $('dateEndFilt').value, postCrewLoad); } when a filter on the grid is selected i automatically refereshes the grid but does not take into account the additional filters in the footer! thanks Cyril Answer posted by dhxSupport on Dec 18, 2009 02:34 Inside dateFilter function before calling crewPrevGrid.clearAndLoad you should get values of other filters in the footer and send them to the server side. On server side you will generate necessary xml which will take into account all existing filters. To get values of other custom filters in the grid you can use: var value=grid.ftr.getElementsByTagName("INPUT")[INDEX].value; |