ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on October 18, 2016, 02:23:25 pm

Title: Optgroup in select
Post by: queensgambit9 on October 18, 2016, 02:23:25 pm
I have a select in toolbar like this:

Code: [Select]
options: [{
 test: 'test',
 test2: 'test2',
 test3: 'test3',
 ...

How could I add optgroup to group test2 and test3?
Title: Re: Optgroup in select
Post by: paramvir on October 18, 2016, 09:34:12 pm
It's done by groupIndx.

Please check the documentation: http://paramquery.com/pro/api#option-column-editor
Title: Re: Optgroup in select
Post by: queensgambit9 on October 19, 2016, 02:31:22 pm
Thanks. Read the documentation but still can't get it right...
Not sure where exactly where to enter the groupIndx...and how do I set the label?
Title: Re: Optgroup in select
Post by: paramvir on October 20, 2016, 01:12:37 pm
groupIndx is used in the filter dropdown in "Shipping Region" column in this example:

http://paramquery.com/pro/demos/filter_header_local
Title: Re: Optgroup in select
Post by: queensgambit9 on October 20, 2016, 01:31:01 pm
Thanks, but my select do not belong to any column (not a filter), its a standalone select in the toolbar with hardcoded select options which execute functions...does it make any difference?

Tried:

options: [
 {test: 'test', groupIndx: 'testgroup'},
 {test2: 'test2'},
 {test3: 'test3'},
 ...

but no success...
Title: Re: Optgroup in select
Post by: paramvir on October 20, 2016, 05:18:59 pm
It hardly matters as the syntax of options and groupIndx is same in toolbar dropdown, editor dropdown and filter dropdown.

Suggest you to read documentation carefully and practise with the online examples and share a jsfiddle if you face any issues.
Title: Re: Optgroup in select
Post by: queensgambit9 on October 20, 2016, 08:46:29 pm
Thanks, struggled a bit and then created a jsfiddle...
Like to group option 2 and 3 with optgroup...

http://jsfiddle.net/zsztzvbz/
Title: Re: Optgroup in select
Post by: paramvir on October 20, 2016, 09:53:23 pm
Please check this: http://jsfiddle.net/zsztzvbz/2/