selectize.jsSelectize.js:添加類別標籤到選擇
是可能的非選擇性類別(標籤)添加到輸入選擇?
的問題是,我有輸入的大名單,這將是偉大的類別(標籤)添加到選擇。就像這樣:
Category 1
---Item1
---Item2
---Item3
---Item4
Category 2
---Item5
---Item6
---Item7
---Item8
...etc
selectize.jsSelectize.js:添加類別標籤到選擇
是可能的非選擇性類別(標籤)添加到輸入選擇?
的問題是,我有輸入的大名單,這將是偉大的類別(標籤)添加到選擇。就像這樣:
Category 1
---Item1
---Item2
---Item3
---Item4
Category 2
---Item5
---Item6
---Item7
---Item8
...etc
您可以同時啓用標籤創建和選項組。它似乎工作here。
使用select
元素,optgroup
爲三類:
<select id="select-gear" class="demo-default" multiple placeholder="Select gear...">
<option value="">Select gear...</option>
<optgroup label="Climbing">
<option value="pitons">Pitons</option>
<option value="sling">Sling</option>
</optgroup>
<optgroup label="Skiing">
<option value="skis">Skis</option>
<option value="skins">Skins</option>
<option value="poles">Poles</option>
</optgroup>
</select>
當你初始化它,使用選項create : true
:
$('#select-gear').selectize({
create: true
});
Selectize.js,因爲它是,只返回一個列表選擇標籤(不管他們在什麼類別)。你的意思是你想讓它返回按類別劃分的選定標籤列表? –