Easygrid icon indicating copy to clipboard operation
Easygrid copied to clipboard

Question - is it possible to set initial filter for particular column (but changable by user)

Open kars7e opened this issue 10 years ago • 4 comments

Hi,

Lets say i have a column 'date', and I would like it to be set to today date whenever user loads the page, however he should be able to change it to some past date. Is there a way to set the default value in filterClosure which would be loaded every time, but with option to change it by user?

kars7e avatar Jun 09 '14 15:06 kars7e

Basically, you want to set a default value in the search input element for that column?

If yes you should use: searchoptions.defaultValue

see: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:search_config

tudor-malene avatar Jun 09 '14 19:06 tudor-malene

What if you want to pass a parameter to the initialCriteria closure when the grid loads, so the user can select a new date range to load and pass as "params" or so when the grid is called initially?

JohnTheBeloved avatar Jun 09 '14 20:06 JohnTheBeloved

Thanks for the answer. Actually my case is little bit more tricky because the initial filter should be "is null" for that particular column. I'm not sure but i think I can't achieve that using only jqgrid options (how to handle null value), I thought there is some backend way to achieve that (something like globalFilterClosure for only first request)..

kars7e avatar Jun 10 '14 09:06 kars7e

Oh, so you want to filter the rows where that date "Is null" ?

Umm, this should be possible, but it's not implemented in the current version.

tudor-malene avatar Jun 10 '14 21:06 tudor-malene