I’m curious how to do something with the PopupFilter, and the Free Search.
I want to limit the Filter & Search by a hidden pre-filter.
Example; Grid should show the records for a specific Period value. I want the Free Search results apply that Period filter always.
Right now I’m just using a query to limit the foundset initially, but I want to do it for the search results too.
I know this is possible somehow but I’m not sure which way to do so. onSearchCommand? onFilterApplyEvent? onFilterApplyQueryCondition? Auto Apply? Sorry I’m just confused which one is used for the case I’m talking about.
Hi John,
what you describe is possible indeed.
Using the onSearchCommand you can amend the generated Query adding extra conditions and load it into the foundset.
As in wiki https://github.com/Servoy/svyPopupFilte … tom-search
// set the onSearchCommand
toolbarFilter.setOnSearchCommand(onSearchCommand)
function onSearchCommand(query, fs) {
// add custom conditions to the query
query.where.add(query.columns.orderdate.not.isNull);
// apply the query to the foundset
fs.loadRecords(query);
}
Regards,
Paolo
paronne:
Hi John,
what you describe is possible indeed.
Using the onSearchCommand you can amend the generated Query adding extra conditions and load it into the foundset.
As in wiki https://github.com/Servoy/svyPopupFilte … tom-search
// set the onSearchCommand
toolbarFilter.setOnSearchCommand(onSearchCommand)
function onSearchCommand(query, fs) {
// add custom conditions to the query
query.where.add(query.columns.orderdate.not.isNull);
// apply the query to the foundset
fs.loadRecords(query);
}
Regards,
Paolo
Thank you!