Hi Jarry, any many thanks for this suggestion.
I have tried this and unfortunately I still seem to get strange behaviour.
I get 3 loads, 1 with no filterRules, then 2 with the filterRules I initialised in the first step.
To complicate matters, I don't have a 'url' based loader, but a custom 'loader' function.
So I am doing:
$dg.datagrid({
url: null,
view: scrollview,
filterRules: [{ field: 'ValidationStatusID', op: 'equal', value: '0' }],
etc...
});
$dg.datagrid('enableFilter', filts);
$dg.datagrid({
loader: function (param, success, error) {
(custom loader here)
}
}
When I declare the loader, then the 3 loads begin. Without this I get an unloaded datagrid with the filter row shown, so I think the first and second parts are OK i.e. I can initialize the datagrid without it trying to load and then enableFilters.
EDIT: also noticed that when trying the 'late' loader above, that enableFilters throws an error 'Cannot read property options of undefined' in the context of the first 2 filters which are comboboxes. See attachedPlease ignore - in the above I'm redefining the whole dg instead of extending. My stupid fault.