📜  jQWidgets jqxDropDownList indeterminateItem() 方法(1)

📅  最后修改于: 2023-12-03 15:32:16.875000             🧑  作者: Mango

jQWidgets jqxDropDownList indeterminateItem() 方法

在jQWidgets中,jqxDropDownList组件提供了indeterminateItem()方法,用于设置下拉列表中的某个选项为不确定状态。

语法
indeterminateItem(index: number): void;
  • index: 必需,表示待设置为不确定状态的选项的索引值,从0开始算起。
示例
// 获取控件
const dropdownlist = $("#dropdownlist").jqxDropDownList({ /* options */ });

// 设置第2个选项为不确定状态
dropdownlist.jqxDropDownList("indeterminateItem", 1);
效果

在下拉列表中,第2个选项即index=1的选项会被显示为灰色背景,表示它处于不确定的状态。此时,无法选择该选项。只有通过调用checkItem(index)uncheckItem(index)方法来设置该选项的选择状态,才能恢复该选项的可选状态。

indeterminateItem

参考链接