最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Tabulator header filter list with optgroup - Stack Overflow

programmeradmin0浏览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 get And 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 like I feel I need to use the custom formatting option but do not see how for the header filter. Any idea ?

Edit, self answer: RTFM ! .3/edit#editor-list I got there by looking at the source code for "listItemFormatter" that pointed me from this deprecated option to the editor.

发布评论

评论列表(0)

  1. 暂无评论