332 Posts
Kenneth
10 years ago
3
Topic

Hi,

This was the only thing I found about this: http://www.seblod.com/v2/forum/Fields/16515-Multi-select-field-with-optgroup.html

I want to group values in a multiselect field, like:

<select>
<optgroup label="Group 1">
<option value ="1">Option 1</option>
<option value ="2">Option 2</option>
</optgroup>
<optgroup label="Group 2">
<option value ="3">Option 3</option>
<option value ="4">Option 3</option>
</optgroup>
</select>

Is this now possible with Seblod?

Get a Book for SEBLOD
4229 Posts
Kadministrator
10 years ago
2
Level 1

By looking at the code it seems there is no such option in select mutiple. Select dynamic has this option, in free mode you can alias column "as optgroup" (this column needs to have the same text value for all record bellonging to the group).

332 Posts
Kenneth
10 years ago
1
Level 2

Could you please share a bit more detail about how to do this correctly?

4229 Posts
Kadministrator
10 years ago
0
Level 3

Hi,

in the free mode you need to specify your query like this: 

SELECT sometitle as text, someid as value, somecolumn as optgroup FROM #__yourtable

So you need to set one column as text, one as value and one as optgroup - to have e.g. state as optgroup you would need to have state name in the state column and then do "state as optgroup" in the query

Get a VIP membership