📅  最后修改于: 2023-12-03 14:43:21.208000             🧑  作者: Mango
The selectedIndex
property is a part of the jQWidgets jqxComboBox widget which is a feature-rich jQuery ComboBox plugin. This property allows the developer to get or set the index of the currently selected item in the ComboBox.
// Get the selected index
var selectedIndex = $('#jqxComboBox').jqxComboBox('selectedIndex');
// Set the selected index
$('#jqxComboBox').jqxComboBox('selectedIndex', index);
index
(Optional): An integer value representing the index of the item to be selected. The index starts from 0 for the first item in the ComboBox.selectedIndex
: An integer value representing the index of the currently selected item in the ComboBox. This value is 0-based.// Get the selected index
var selectedIndex = $('#jqxComboBox').jqxComboBox('selectedIndex');
// Set the selected index
$('#jqxComboBox').jqxComboBox('selectedIndex', 2);
The selectedIndex
property can be used to retrieve the current selected index or set the selected index of the jqxComboBox widget. The selectedIndex
property accepts an optional parameter index
which specifies the index value to be selected.
selectedIndex
property returns -1.The selectedIndex
property of the jQWidgets jqxComboBox widget is a helpful tool for managing the selection of items in a ComboBox. It allows developers to easily retrieve the current selected index or set a new selected index.