ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: NearEarthObject on March 19, 2022, 07:17:26 pm

Title: refresh method and filter
Post by: NearEarthObject on March 19, 2022, 07:17:26 pm
Hi Param Team !

I currently have a grid, who offer the ability to choose the diffferent the different header fields ( colModel) the want to display or not. The operation run through an ajax call, who rebuilt the col model affecting hidden or not depending of the quary. Tha ajax call return the new colmodel confoguration.
At this time on success function, I simply apply :
grid.option('colModel', data);
grid.refreshCM();

The probleme I am facing, is that all previous filter applied to the grid are totally reseting.

Any idea regarding an elegant way to refresh the grid by maintaining the selected filter, a little like the "ui-icon ui-icon-refresh" is doing ate the footer of the grid ? Or may I ask something impossible ?

Thanks in advance
Title: Re: refresh method and filter
Post by: paramvir on March 21, 2022, 10:39:54 am
To keep previous filter state, please don't replace the entire colModel, rather mutate the previous colModel by adding new columns or removing columns.