I have a grid with dataModel.location="remote"
Just on the first load (one off when data loaded for the first time only) I want to set an initial filter on a column. So when refresh, add/remove filters, etc. it must NOT revert to the initial filter option.
I want to avoid calling the remote server twice.
After building the table, I have tried making the dataModel.location="local", applying the filter then dataModel.location="remote" which works, but is there a cleaner way to set the initial filter in "options"?
I have tried using grid.one like below, however this calls the remote server to load the data twice, being one time to load the initial data (unfiltered) then again after the "one" is called with a new filter.
grid.one("load", function (evt, ui) {
// Apply initial filtering.
grid.filter({
oper: "add",
rules: [
{ dataIndx: "DEPOT", value: ["London"] },
]
});
});