ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on February 10, 2020, 07:12:20 pm

Title: Select in toolbar
Post by: queensgambit9 on February 10, 2020, 07:12:20 pm
Is it possible to include value of toolbar select in a state?
Title: Re: Select in toolbar
Post by: paramvir on February 10, 2020, 10:03:24 pm
The API was not pre designed for it but I found it working.

First include the toolbar items in the state with stateKeys option.

Code: [Select]
stateKeys : { toolbar: ['items']}

Then during restoration of state, please add this besides call to loadState:

Code: [Select]
grid.option('toolbar').items[index of select item in the toolbar].value = JSON.parse(grid.getState()).toolbar.items[index of select item in the toolbar].value
grid.refreshToolbar();