Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 646

Tabulator header filter list with optgroup

$
0
0

Using Tabulator 6.3 and header filters, did someone manage to build a list of grouped values ?I'm already feeding the values with a custom list built from an ajax call, but how to tell Tabulator to group these values ?

Here is my list

[{ value: "V1", group: "A group" },{ value: "V2", group: "A group" },{ value: "V3", group: "A group" },{ value: "V4", group: "A group" },{ value: "V12", machinelist: "Another group" },{ value: "V13", machinelist: "Another group" },{ value: "V14", machinelist: "Another group" },{ value: "V15", machinelist: "Another group" }]

I tried the groupBy option, no chance.

I get this with a standard array of values:

<select multiple><option value="V1">V1</option> <option value="V2">V2</option> <option value="V3">V3</option> <option value="V4">V4</option> <option value="V12">V12</option><option value="V13">V13</option><option value="V14">V14</option><option value="V15">V15</option></select>

What I getAnd would like to get something like this:

<select multiple><optgroup label="A group"><option value="V1">V1</option> <option value="V2">V2</option> <option value="V3">V3</option> <option value="V4">V4</option> </optgroup><optgroup label="Another group"><option value="V12">V12</option><option value="V13">V13</option><option value="V14">V14</option><option value="V15">V15</option></optgroup></select>

What I'd likeI feel I need to use the custom formatting option but do not see how for the header filter.Any idea ?

Edit, self answer: RTFM ! https://tabulator.info/docs/6.3/edit#editor-listI got there by looking at the source code for "listItemFormatter" that pointed me from this deprecated option to the editor.


Viewing all articles
Browse latest Browse all 646

Trending Articles