Bar*_*n23 1 javascript html-select
我有以下数组:
options = [
"Asset Management & Investment Funds",
"Financial Institutions",
"Life Sciences",
"TMT",
"Other"
]
Run Code Online (Sandbox Code Playgroud)
Choices.js默认按字母顺序排序,Other最后排在前面,TMT这对用户来说是刺耳的。
const $projectDropdown = new Choices($this[0], {
placeholder: true,
placeholderValue: 'Select a project'
})
Run Code Online (Sandbox Code Playgroud)
我尝试查看该sortFilter函数,但它仅指定了排序方法。
看起来您需要该属性shouldSort。该自述有更多的细节。
const $projectDropdown = new Choices($this[0], {
placeholder: true,
placeholderValue: 'Select a project'
shouldSort: false,
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
983 次 |
| 最近记录: |