PDA

View Full Version : Grid Date Filter Set Value



tomdchi
9 Jun 2020, 8:13 AM
On a grid date filter how would you select a date before render? I can get a reference to the filter with


onGridBeforeRender: function(component, eOpts) {
var filter = component.down('#dateCreated').filter;

}

After that how would I select a date in the Before field?

tomdchi
25 Jun 2020, 6:30 AM
In case anyone else needs to know how to do this...

On = eq
Before = lt
After = gt

In view controller:


onGridBeforeRender: function(component, eOpts) {
var filter = component.down('#effectiveDate').filter;
filter.setValue({eq: new Date()});
}


In view:



filter: {
type: 'date',
value: {
eq: new Date()
}
}


You could also set more than one option:



filter.setValue({eq: new Date(), lt: new Date(2016, 9, 27)});