PDA

View Full Version : Manually Set Date Filtersfeature?



wilfogn
22 Feb 2016, 2:11 PM
I have been able to manually add filters to the filtersfeature on my grid but am struggling to activate the before/after/on datepicker with a button press. Thank you.

(https://fiddle.sencha.com/#fiddle/163n)https://fiddle.sencha.com/#fiddle/163n

This fiddle sets the date manually but I cant locate the filtersfeature datepickers.

https://fiddle.sencha.com/#fiddle/5l7 (http:// https://fiddle.sencha.com/#fiddle/5l7)

Gary Schlosberg
23 Feb 2016, 1:59 PM
So when someone clicks the 'Filter' button, are you wanting to apply the filter or activate the date picker?

wilfogn
23 Feb 2016, 3:05 PM
Apply the filter and check the correct boxes in the column menu to indicate to the user that the filter exists. Thank you.

Update: got it, I was recreating the filter which is not at all needed, just needed appropriate setValue the format of which varies(numeric uses eq, gt, lt)(date before, on, after).



grid.filters.getFilter('data_index_name').setValue({on: new Date('03/07/2016 00:00:01 PM GMT-0600')});
grid.filters.getFilter('data_index_name').setActive(true);