Name
|
Type
|
Default
|
autoOpen
|
Boolean
|
false
|
Sets or gets whether the DropDown is automatically opened when the mouse cursor is moved over the widget.
Code example
Set the autoOpen property.
$("#jqxDropDownList").jqxDropDownList({ autoOpen: true });
Get the autoOpen property.
var autoOpen = $('#jqxDropDownList').jqxDropDownList('autoOpen');
|
autoItemsHeight
|
Boolean
|
false
|
Sets or gets whether items will wrap when they reach the width of the dropDown.
Code example
Set the autoItemsHeight property.
$("#jqxDropDownList").jqxDropDownList({autoItemsHeight: true});
Get the autoItemsHeight property.
var autoItemsHeight = $('#jqxDropDownList').jqxDropDownList('autoItemsHeight');
|
autoDropDownHeight
|
Boolean
|
false
|
Sets or gets whether the height of the jqxDropDownList's ListBox displayed in the widget's DropDown is calculated as a sum of the items heights.
Code example
Set the autoDropDownHeight property.
$("#jqxDropDownList").jqxDropDownList({autoDropDownHeight: true});
Get the autoDropDownHeight property.
var autoDropDownHeight = $('#jqxDropDownList').jqxDropDownList('autoDropDownHeight');
|
animationType
|
String
|
'slide'
|
Sets or gets the type of the animation.
Possible Values:
'fade'
'slide'
'none'
Code example
Set the animationType property
$('#jqxDropDownList').jqxDropDownList({animationType: 'none'});
Get the animationType property.
var animationType = $('#jqxDropDownList').jqxDropDownList('animationType');
|
checkboxes
|
Boolean
|
false
|
Determines whether checkboxes will be displayed next to the list items. (The feature requires jqxcheckbox.js)
Code example
Set the checkboxes property.
$("#jqxDropDownList").jqxDropDownList({checkboxes:true});
Get the checkboxes property.
var checkboxes = $('#jqxDropDownList').jqxDropDownList('checkboxes');
|
closeDelay
|
Number
|
400
|
Sets or gets the delay of the 'close' animation.
Code example
Set the closcloseDelay Delay property
$('#jqxDropDownList').jqxDropDownList({closeDelay: 200});
Get the closeDelay property.
var closeDelay = $('#jqxDropDownList').jqxDropDownList('closeDelay');
|
disabled
|
Boolean
|
false
|
Enables/disables the jqxDropDownList.
Code example
Set the disabled property.
$("#jqxDropDownList").jqxDropDownList({ disabled: true });
Get the disabled property.
var disabled = $('#jqxDropDownList').jqxDropDownList('disabled');
|
displayMember
|
String
|
""
|
Sets or gets the displayMember of the Items. The displayMember specifies the name of an object property to display. The name is contained in the collection specified by the 'source' property.
Code example
Set the displayMember property.
$("#jqxDropDownList").jqxDropDownList({displayMember: 'firstName'});
Get the displayMember property.
var displayMember = $('#jqxDropDownList').jqxDropDownList('displayMember');
|
dropDownHorizontalAlignment
|
String
|
'left'
|
Sets or gets the DropDown's alignment.
Possible Values:
'left'
'right'
Code example
Set the dropDownHorizontalAlignment property.
$('#jqxDropDownList').jqxDropDownList({ dropDownHorizontalAlignment: 'right'});
Get the dropDownHorizontalAlignment property.
var dropDownHorizontalAlignment = $('#jqxDropDownList').jqxDropDownList('dropDownHorizontalAlignment');
|
dropDownVerticalAlignment
|
String
|
'bottom'
|
Sets or gets the DropDown's alignment.
Possible Values:
'top'
'bottom'
Code example
$('#jqxDropDownList').jqxDropDownList({ dropDownVerticalAlignment: 'top'});
Get the dropDownVerticalAlignment property.
var dropDownVerticalAlignment = $('#jqxDropDownList').jqxDropDownList('dropDownVerticalAlignment');
|
dropDownHeight
|
Number
|
200
|
Sets or gets the height of the jqxDropDownList's ListBox displayed in the widget's DropDown.
Code example
Set the dropDownHeight property.
$("#jqxDropDownList").jqxDropDownList({dropDownHeight: 250});
Get the dropDownHeight property.
var dropDownHeight = $('#jqxDropDownList').jqxDropDownList('dropDownHeight');
|
dropDownWidth
|
Number
|
200
|
Sets or gets the width of the jqxDropDownList's ListBox displayed in the widget's DropDown.
Code example
Set the dropDownWidth property.
$("#jqxDropDownList").jqxDropDownList({dropDownWidth: 250});
Get the dropDownWidth property.
var dropDownWidth = $('#jqxDropDownList').jqxDropDownList('dropDownWidth');
|
enableSelection
|
Boolean
|
true
|
Enables/disables the selection.
Code example
Set the enableSelection property.
$("#jqxDropDownList").jqxDropDownList({enableSelection:false});
Get the enableSelection property.
var enableSelection = $('#jqxDropDownList').jqxDropDownList('enableSelection');
|
enableBrowserBoundsDetection
|
Boolean
|
false
|
Sets or gets whether the dropdown detects the browser window's bounds and automatically adjusts the dropdown's position.
Code example
Set the enableBrowserBoundsDetection property.
$("#jqxDropDownList").jqxDropDownList({enableBrowserBoundsDetection:false});
Get the enableBrowserBoundsDetection property.
var enableBrowserBoundsDetection = $('#jqxDropDownList').jqxDropDownList('enableBrowserBoundsDetection');
|
enableHover
|
Boolean
|
true
|
Enables/disables the hover state.
Code example
Set the enableHover property.
$("#jqxDropDownList").jqxDropDownList({enableHover: false});
Get the enableHover property.
var enableHover = $('#jqxDropDownList').jqxDropDownList('enableHover');
|
filterable
|
Boolean
|
false
|
Determines whether the Filtering is enabled.
Code example
Set the filterable property.
$("#jqxDropDownList").jqxDropDownList({filterable:true});
Get the filterable property.
var filterable = $('#jqxDropDownList').jqxDropDownList('filterable');
|
filterHeight
|
Number
|
27
|
Determines the Filter's height.
Code example
Set the filterHeight property.
$("#jqxDropDownList").jqxDropDownList({filterHeight:30});
Get the filterHeight property.
var filterHeight = $('#jqxDropDownList').jqxDropDownList('filterHeight');
|
filterDelay
|
Number
|
100
|
Determines the Filter's delay. After 100 milliseconds, the widget automatically filters its data based on the filter input's value. To perform filter only on "Enter" key press, set this property to 0.
Code example
Set the filterDelay property.
$("#jqxDropDownList").jqxDropDownList({filterDelay:300});
Get the filterDelay property.
var filterDelay = $('#jqxDropDownList').jqxDropDownList('filterDelay');
|
filterPlaceHolder
|
String
|
"Looking for"
|
Determines the Filter input's place holder.
Code example
Set the filterPlaceHolder property.
$("#jqxDropDownList").jqxDropDownList({filterPlaceHolder:300});
Get the filterPlaceHolder property.
var filterPlaceHolder = $('#jqxDropDownList').jqxDropDownList('filterPlaceHolder');
|
height
|
Number/String
|
null
|
Sets or gets the jqxDropDownList's height.
Code example
Set the height property.
$("#jqxDropDownList").jqxDropDownList({ height: '250px' });
Get the height property.
var height = $('#jqxDropDownList').jqxDropDownList('height');
|
incrementalSearch
|
Boolean
|
true
|
Sets or gets the incrementalSearch property. An incremental search begins searching as soon as you type the first character of the search string. As you type in the search string, jqxDropDownList automatically selects the found item.
Code example
Set the incrementalSearch property.
$("#jqxDropDownList").jqxDropDownList({incrementalSearch: false});
Get the incrementalSearch property.
var incrementalSearch = $('#jqxDropDownList').jqxDropDownList('incrementalSearch');
|
incrementalSearchDelay
|
Number
|
700
|
Sets or gets the incrementalSearchDelay property. The incrementalSearchDelay specifies the time-interval in milliseconds after which the previous search string is deleted. The timer starts
when you stop typing.
Code example
Set the incrementalSearchDelay property.
$("#jqxDropDownList").jqxDropDownList({incrementalSearchDelay: 400});
Get the incrementalSearchDelay property.
var incrementalSearchDelay = $('#jqxDropDownList').jqxDropDownList('incrementalSearchDelay');
|
itemHeight
|
Number
|
-1
|
Sets or gets the height of the jqxDropDownList Items. When the itemHeight == - 1,
each item's height is equal to its desired height.
Code example
Set the itemHeight property.
$("#jqxDropDownList").jqxDropDownList({itemHeight: 25});
Get the itemHeight property.
var itemHeight = $('#jqxDropDownList').jqxDropDownList('itemHeight');
|
openDelay
|
Number
|
350
|
Sets or gets the delay of the 'open' animation.
Code example
Set the openDelay property
$('#jqxDropDownList').jqxDropDownList({openDelay: 200});
Get the openDelay property.
var openDelay = $('#jqxDropDownList').jqxDropDownList('openDelay');
|
placeHolder
|
String
|
"Please Choose:"
|
Text displayed when the selection is empty.
Code example
Set the promptText property.
$("#jqxDropDownList").jqxDropDownList({placeHolder: "Select:"});
Get the promptText property.
var promptText = $('#jqxDropDownList').jqxDropDownList('placeHolder');
|
popupZIndex
|
Number
|
20000
|
Sets or gets the popup's z-index.
Code example
Set the popupZIndex property.
$("#jqxDropDownList").jqxDropDownList({popupZIndex: 999999});
Get the popupZIndex property.
var zIndex = $('#jqxDropDownList').jqxDropDownList('popupZIndex');
|
rtl
|
Boolean
|
false
|
Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.
Code example
Set the rtl property.
$('#jqxDropDownList').jqxDropDownList({rtl : true});
Get the rtl property.
var rtl = $('#jqxDropDownList').jqxDropDownList('rtl');
|
renderer
|
Function
|
null
|
Callback function which is called when an item is rendered. By using the renderer function, you can customize the look of the list items.
Code example
Set the renderer property
$('#jqxDropDownList').jqxDropDownList({renderer: function (index, label, value)
{
var datarecord = data[index];
return datarecord.firstname + " " + datarecord.lastname;
}
});
Get the renderer property.
var renderer = $('#jqxDropDownList').jqxDropDownList('renderer');
|
selectionRenderer
|
Function
|
null
|
Callback function which is called when the selected item is rendered in the jqxDropDownList's content area. By using the selectionRenderer function, you can customize the look of the selected item.
Code example
Set the selectionRenderer property
$('#jqxDropDownList').jqxDropDownList({selectionRenderer: function (htmlString)
{
return "My String";
}
});
Get the selectionRenderer property.
var selectionRenderer = $('#jqxDropDownList').jqxDropDownList('selectionRenderer');
|
searchMode
|
String
|
startswith
|
Sets or gets the item incremental search mode. When the user types some text in a focused DropDownList,
the jqxListBox widget tries to find the searched item using the entered text and the selected search mode.
Possible Values:
'none'
'contains'
'containsignorecase'
'equals'
'equalsignorecase'
'startswithignorecase'
'startswith'
'endswithignorecase'
'endswith'
Code example
Set the searchMode property.
$("#jqxDropDownList").jqxDropDownList({searchMode: 'contains' });
Get the searchMode property.
var searchMode = $('#jqxDropDownList').jqxDropDownList('searchMode');
|
scrollBarSize
|
Number
|
17
|
Sets or gets the scrollbars size.
Code example
Set the scrollBarSize property.
$("#jqxDropDownList").jqxDropDownList({scrollBarSize:25});
Get the scrollBarSize property.
var scrollBarSize = $('#jqxDropDownList').jqxDropDownList('scrollBarSize');
|
source
|
Array
|
null
|
Sets or gets the items source.
Code example
Set the source property.
var data = [
"Affogato",
"Americano",
"Bicerin"
];
$("#jqxDropDownList").jqxDropDownList({source: data});
Binding using the jqx.dataAdapter(requires jqxdata.js):
// url of the data.
var url = "../sampledata/customers.txt";
var parentsLength = $("#jqxWidget").parents().length;
if (parentsLength > 3) {
url = 'demos/sampledata/customers.txt';
}
// prepare the data. Set the datatype to 'json', 'xml', 'tsv', 'array', 'local' or 'csv.
var source =
{
datatype: "json",
datafields: [
{ name: 'CompanyName' },
{ name: 'ContactName' }
],
id: 'id',
url: url
};
// create a new instance of the jqx.dataAdapter.
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxDropDownList
$("#jqxWidget").jqxDropDownList({ source: dataAdapter, displayMember: "ContactName", valueMember: "CompanyName", width: 200, height: 250});
Get the source property.
var source = $('#jqxDropDownList').jqxDropDownList('source');
|
selectedIndex
|
Number
|
-1
|
Sets or gets the selected index.
Code example
Set the selectedIndex property.
$("#jqxDropDownList").jqxDropDownList({selectedIndex: 2 });
Get the selectedIndex property.
var selectedIndex = $('#jqxDropDownList').jqxDropDownList('selectedIndex');
|
template
|
String
|
'default'
|
Determines the template as an alternative of the default styles.
Possible Values:
'default' - the default template. The style depends only on the "theme" property value.
'primary' - dark blue style for extra visual weight.
'success' - green style for successful or positive action.
'warning' - orange style which indicates caution.
'danger' - red style which indicates a dangerous or negative action.
'info' - blue button, not tied to a semantic action or use.
Code examples
Set the template property.
$("#jqxDropDownList").jqxDropDownList({ template: 'primary'});
Get the template property.
var template = $('#jqxDropDownList').jqxDropDownList('template');
|
theme
|
String
|
''
|
Sets the widget's theme.
jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file.
In order to set a theme, you need to do the following:
|
valueMember
|
String
|
""
|
Sets or gets the valueMember of the Items. The valueMember specifies the name of an object property to set as a 'value' of the list items. The name is contained in the collection specified by the 'source' property.
Code example
Set the valueMember property.
$("#jqxDropDownList").jqxDropDownList({valueMember: 'lastName'});
Get the valueMember property.
var valueMember = $('#jqxDropDownList').jqxDropDownList('valueMember');
|
width
|
Number/String
|
null
|
Sets or gets the jqxDropDownList's width.
Code example
Set the width property.
$("#jqxDropDownList").jqxDropDownList({ width: '250px' });
Get the width property.
var width = $('#jqxDropDownList').jqxDropDownList('width');
|
|
bindingComplete
|
Event
|
|
This event is triggered when the data binding operation is completed.
Code example
Bind to the bindingComplete event by type: jqxDropDownList.
$("#jqxDropDownList").on('bindingComplete', function (event) { });
|
close
|
Event
|
|
This event is triggered when the popup ListBox is closed.
Code example
Bind to the close by type: jqxDropDownList.
$('#jqxDropDownList').on('close', function (event) { // Some code here. });
|
checkChange
|
Event
|
|
This event is triggered when an item is checked/unchecked.
Code example
Bind to the checkChange by type: jqxDropDownList.
$("#jqxDropDownList").on('checkChange', function (event)
{
if (event.args) {
var item = event.args.item;
var value = item.value;
var label = item.label;
var checked = item.checked;
var checkedItems = $("#jqxDropDownList").jqxDropDownList('getCheckedItems');
}
});
The item object has the following fields:
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
|
change
|
Event
|
|
This event is triggered when the user selects an item.
Code example
Bind to the change by type: jqxDropDownList.
$('#jqxDropDownList').on('change', function (event)
{
var args = event.args;
if (args) {
// index represents the item's index.
var index = args.index;
var item = args.item;
// get item's label and value.
var label = item.label;
var value = item.value;
var type = args.type; // keyboard, mouse or null depending on how the item was selected.
}
});
The item object has the following fields:
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
|
open
|
Event
|
|
This event is triggered when the popup ListBox is opened.
Code example
Bind to the open by type: jqxDropDownList.
$('#jqxDropDownList').on('open', function (event) { // Some code here. });
|
select
|
Event
|
|
This event is triggered when the user selects an item.
Code example
Bind to the select event by type: jqxDropDownList.
$('#jqxDropDownList').on('select', function (event)
{
var args = event.args;
if (args) {
// index represents the item's index.
var index = args.index;
var item = args.item;
// get item's label and value.
var label = item.label;
var value = item.value;
var type = args.type; // keyboard, mouse or null depending on how the item was selected.
}
});
The item object has the following fields:
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
|
unselect
|
Event
|
|
This event is triggered when the user unselects an item.
Code example
Bind to the unselect event by type: jqxDropDownList.
$('#jqxDropDownList').on('unselect', function (event)
{
var args = event.args;
if (args) {
// index represents the item's index.
var index = args.index;
var item = args.item;
// get item's label and value.
var label = item.label;
var value = item.value;
}
});
The item object has the following fields:
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
|
|
addItem
|
Method
|
|
Adds a new item to the jqxDropDownList. Returns 'true', if the new item is added or 'false' if the item is not added.
The following fields can be used for the new item:
- label - determines the item's label.
- value - determines the item's value.
- disabled - determines whether the item is enabled/disabled.
- checked - determines whether item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - determines the item's display html. This can be used instead of label.
- group - determines the item's group.
Parameter |
Type |
Description |
item |
Object/String |
|
Return Value
None
Code example
Invoke the addItem method.
// @param String
$("#jqxDropDownList").jqxDropDownList('addItem', 'jQuery' );
Code example 2
Invoke the addItem method.
// @param Object
$("#jqxDropDownList").jqxDropDownList('addItem', { label: 'Text' value: 'Id'} );
|
clearSelection
|
Method
|
|
Clears all selected items.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the clearSelection method.
$("#jqxDropDownList").jqxDropDownList('clearSelection');
|
clear
|
Method
|
|
Clears all items.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the clear method.
$("#jqxDropDownList").jqxDropDownList('clear');
|
close
|
Method
|
|
Hides the popup listbox.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the close method.
$("#jqxDropDownList").jqxDropDownList("close" );
|
checkIndex
|
Method
|
|
Checks a list item when the 'checkboxes' property value is true. The index is zero-based, i.e to check the first item, the 'checkIndex' method should be called with parameter 0.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the checkIndex method.
$("#jqxDropDownList").jqxDropDownList('checkIndex', 0);
|
checkItem
|
Method
|
|
Checks an item.
Parameter |
Type |
Description |
item |
Object/String |
|
Return Value
None
Code example
Invoke the checkItem method.
// @param list Item
$("#jqxDropDownList").jqxDropDownList('checkItem', item );
*To get an item, use the getItem or getItemByValue methods.
|
checkAll
|
Method
|
|
Checks all list items when the 'checkboxes' property value is true.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the checkAll method.
$("#jqxDropDownList").jqxDropDownList('checkAll');
|
clearFilter
|
Method
|
|
Clears the widget's filter when filtering is applied.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code examples
Invoke the clearFilter method.
$('#jqxDropDownList').jqxDropDownList('clearFilter');
|
destroy
|
Method
|
|
Destroys the widget.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code examples
Invoke the destroy method.
$('#jqxDropDownList').jqxDropDownList('destroy');
|
disableItem
|
Method
|
|
Disables an item. Item is an Object.
The following fields can be used for the item:
- label - determines the item's label.
- value - determines the item's value.
- disabled - determines whether the item is enabled/disabled.
- checked - determines whether item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - determines the item's display html. This can be used instead of label.
- group - determines the item's group.
Parameter |
Type |
Description |
item |
Object/String |
|
Return Value
None
Code example
Invoke the disableItem method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('disableItem', "jQuery" );
|
disableAt
|
Method
|
|
Disables an item by index. Index is a number.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the disableAt method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('disableAt', 8 );
|
enableItem
|
Method
|
|
Enables an item. Item is an Object.
The following fields can be used for the item:
- label - determines the item's label.
- value - determines the item's value.
- disabled - determines whether the item is enabled/disabled.
- checked - determines whether item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - determines the item's display html. This can be used instead of label.
- group - determines the item's group.
Parameter |
Type |
Description |
item |
Object/String |
|
Return Value
None
Code example
Invoke the enableItem method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('enableItem', "jQuery" );
|
enableAt
|
Method
|
|
Enables a disabled item by index. Index is a number.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the enableAt method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('enableAt', 3 );
|
ensureVisible
|
Method
|
|
Ensures that an item is visible. index is number. When necessary, the jqxDropDownList
scrolls to the item to make it visible.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the ensureVisible method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('ensureVisible', 2 );
|
focus
|
Method
|
|
Sets the focus to the widget.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the focus method.
$("#jqxDropDownList").jqxDropDownList('focus');
|
getItem
|
Method
|
|
Gets item by index. The returned value is an Object with the following fields:
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the getItem method.
// @param Number
var item = $("#jqxDropDownList").jqxDropDownList('getItem', 1 );
|
getItemByValue
|
Method
|
|
Gets an item by its value. The returned value is an Object with the following fields:
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
Parameter |
Type |
Description |
itemValue |
String |
|
Return Value
None
Code example
Invoke the getItemByValue method.
// @param Value
var item = $("#jqxDropDownList").jqxDropDownList('getItemByValue', "Bon app'");
|
getItems
|
Method
|
|
Gets all items. The returned value is an array of Items.
Each item represents an Object with the following fields.
Item Fields
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
Parameter |
Type |
Description |
None |
|
|
Return Value
Array
Code example
Invoke the getItems method.
var items = $("#jqxDropDownList").jqxDropDownList('getItems');
Get the first item.
var items = $("#jqxDropDownList").jqxDropDownList('getItems'); var firstItem = items[0];
|
getCheckedItems
|
Method
|
|
Gets the checked items. The returned value is an array of Items.
Each item represents an Object with the following fields.
Item Fields
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
Parameter |
Type |
Description |
None |
|
|
Return Value
Array
Code example
Invoke the getCheckedItems method.
var items = $("#jqxDropDownList").jqxDropDownList('getCheckedItems');
|
getSelectedItem
|
Method
|
|
Gets the selected item. The returned value is an Object or null(if there is no selected item).
Item Fields
- label - gets item's label.
- value - gets the item's value.
- disabled - gets whether the item is enabled/disabled.
- checked - gets whether the item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - gets the item's display html. This can be used instead of label.
- index - gets the item's index.
- group - gets the item's group.
Parameter |
Type |
Description |
None |
|
|
Return Value
Object
Code example
Invoke the getSelectedItem method.
// @param Number
var item = $("#jqxDropDownList").jqxDropDownList('getSelectedItem');
|
getSelectedIndex
|
Method
|
|
Gets the index of the selected item. The returned value is the index of the selected item. If there's no selected item, -1 is returned.
Parameter |
Type |
Description |
None |
|
|
Return Value
Number
Code example
Invoke the getSelectedIndex method.
// @param Number
var index = $("#jqxDropDownList").jqxDropDownList('getSelectedIndex');
|
insertAt
|
Method
|
|
Inserts a new item to the jqxDropDownList. Returns 'true', if the new item is inserted or false if the insertaion fails. The first parameter is Object or String - the new item. The second parameter is Number - the item's index.
The following fields can be used for the new item:
- label - determines the item's label.
- value - determines the item's value.
- disabled - determines whether the item is enabled/disabled.
- checked - determines whether item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - determines the item's display html. This can be used instead of label.
- group - determines the item's group.
Parameter |
Type |
Description |
item |
Object/String |
|
index |
Number |
|
Return Value
None
Code example
Invoke the insertAt method.
// @param String
// @param Number
$("#jqxDropDownList").jqxDropDownList('insertAt', 'jQuery', 1 );
Code example 2
Invoke the insertAt method.
// @param Object
// @param Number
$("#jqxDropDownList").jqxDropDownList('insertAt', '{ label: 'Text' value: 'Id'}, 1 );
|
isOpened
|
Method
|
|
Returns true, if the popup is opened. Otherwise returns false.
Parameter |
Type |
Description |
None |
|
|
Return Value
Boolean
Code example
Invoke the isOpened method.
var opened = $("#jqxDropDownList").jqxDropDownList('isOpened' );
|
indeterminateIndex
|
Method
|
|
indeterminates a list item when the 'checkboxes' property value is true. The index is zero-based, i.e to indeterminate the first item, the 'indeterminateIndex' method should be called with parameter 0.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the indeterminateIndex method.
$("#jqxDropDownList").jqxDropDownList('indeterminateIndex', 0);
|
indeterminateItem
|
Method
|
|
Indeterminates an item.
Parameter |
Type |
Description |
item |
Object/String |
|
Return Value
None
Code example
Invoke the indeterminateItem method.
// @param list Item
$("#jqxDropDownList").jqxDropDownList('indeterminateItem', item );
*To get an item, use the getItem or getItemByValue methods.
|
loadFromSelect
|
Method
|
|
Loads list items from a 'select' tag.
Parameter |
Type |
Description |
id |
String |
|
Return Value
None
Code example
Invoke the loadFromSelect method.
$("#jqxDropDownList").jqxDropDownList('loadFromSelect', 'select');
'select' is the id of a select tag.
Code Example:
<select style='height: 25px; width: 200px; margin-left: 30px;' id='select'> <option>Affogato</option> <option>Americano</option> <option>Bicerin</option> <option>Breve</option> <option>Café Bombón</option> <option>Caffé Corretto</option> <option>Café Crema</option> <option>Caffé Latte</option> <option>Caffé macchiato</option> <option>Café mélange</option> <option>Coffee milk</option> <option>Cafe mocha</option> <option>Cappuccino</option> <option>Carajillo</option> <option>Cuban espresso</option> <option>Espresso</option> <option>The Flat White</option> <option>Frappuccino</option> <option>Galao</option> <option>Greek frappé coffee</option> <option>Iced Coffee</option> <option>Indian filter coffee</option> <option>Instant coffee</option> <option>Irish coffee</option> <option>Liqueur coffee</option> </select>
|
open
|
Method
|
|
Shows the popup listbox.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the open method.
$("#jqxDropDownList").jqxDropDownList('open' );
|
removeItem
|
Method
|
|
Removes an item from the listbox. Parameter type: Object returned by the "getItem" method or String - the value of an item. Returns 'true', if the item is removed or 'false', if the
item is not removed.
Parameter |
Type |
Description |
item |
Object/String |
|
Return Value
None
Code example
Invoke the removeItem method.
// @param Object
$("#jqxDropDownList").jqxDropDownList('removeItem', "List Item" );
|
removeAt
|
Method
|
|
Removes an item from the listbox. Parameter type: Number - the index of the item. The method returns 'true', if the item is removed or 'false', if the
item is not removed.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the removeAt method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('removeAt', 3 );
|
selectIndex
|
Method
|
|
Selects an item by index. The index is zero-based, i.e to select the first item, the 'selectIndex' method should be called with parameter 0.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the selectIndex method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('selectIndex', 0 );
|
selectItem
|
Method
|
|
Selects an item.
Parameter |
Type |
Description |
item |
Object |
|
Return Value
None
Code example
Invoke the selectItem method.
// @param List Item
$("#jqxDropDownList").jqxDropDownList('selectItem', item );
*To get an item, use the getItem or getItemByValue methods.
|
setContent
|
Method
|
|
Sets the content of the DropDownList.
Parameter |
Type |
Description |
content |
String |
|
Return Value
None
Code example
Invoke the setContent method.
$("#jqxDropDownList").jqxDropDownList('setContent', 'My Content');
|
updateItem
|
Method
|
|
Updates an item. The first parameter is the new item. The second parameter could be an existing item or the value of an existing item.
The following fields can be used for the item:
- label - determines the item's label.
- value - determines the item's value.
- disabled - determines whether the item is enabled/disabled.
- checked - determines whether item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - determines the item's display html. This can be used instead of label.
- group - determines the item's group.
Parameter |
Type |
Description |
newItem |
Object |
|
item |
Object/String |
|
Return Value
None
Code example
Invoke the updateItem method.
// @param Object
// @param Object
$("#jqxDropDownList").jqxDropDownList('updateItem', { label: "Text", value: "Id1" }, "Antonio Moreno Taquera");
|
updateAt
|
Method
|
|
Updates an item. The first parameter is the new item. The second parameter is the index of the item to be updated.
The following fields can be used for the item:
- label - determines the item's label.
- value - determines the item's value.
- disabled - determines whether the item is enabled/disabled.
- checked - determines whether item is checked/unchecked.
- hasThreeStates - determines whether the item's checkbox supports three states.
- html - determines the item's display html. This can be used instead of label.
- group - determines the item's group.
Parameter |
Type |
Description |
item |
Object |
|
index |
Number |
|
Return Value
None
Code example
Invoke the updateAt method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('updateAt', { label: "Text", value: "Id1" }, 3 );
|
unselectIndex
|
Method
|
|
Unselects item by index. The index is zero-based, i.e to unselect the first item, the 'unselectIndex' method should be called with parameter 0.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the unselectIndex method.
// @param Number
$("#jqxDropDownList").jqxDropDownList('unselectIndex', 5 );
|
unselectItem
|
Method
|
|
Unselects an item.
Parameter |
Type |
Description |
item |
Object/String |
|
Return Value
None
Code example
Invoke the unselectItem method.
// @param List Item
$("#jqxDropDownList").jqxDropDownList('unselectItem', item );
*To get an item, use the getItem or getItemByValue methods.
|
uncheckIndex
|
Method
|
|
Unchecks a list item when the 'checkboxes' property value is true. The index is zero-based, i.e to uncheck the first item, the 'uncheckIndex' method should be called with parameter 0.
Parameter |
Type |
Description |
index |
Number |
|
Return Value
None
Code example
Invoke the uncheckIndex method.
$("#jqxDropDownList").jqxDropDownList('uncheckIndex', 0);
|
uncheckItem
|
Method
|
|
Unchecks an item.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the uncheckItem method.
// @param list Item
$("#jqxDropDownList").jqxDropDownList('uncheckItem', item );
*To get an item, use the getItem or getItemByValue methods.
|
uncheckAll
|
Method
|
|
Unchecks all list items when the 'checkboxes' property value is true.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code example
Invoke the uncheckAll method.
$("#jqxDropDownList").jqxDropDownList('uncheckAll');
|
val
|
Method
|
|
Sets or gets the selected value.
Parameter |
Type |
Description |
value |
String |
|
Return Value
String
Code example
Invoke the val method.
// Get the value.
var value = $("#jqxDropDownList").jqxDropDownList('val');
// Get the value using jQuery's val()
var value = $("#jqxDropDownList").val();
// Set value.
$("#jqxDropDownList").jqxDropDownList('val', 'New Value');
// Set value using jQuery's val().
$("#jqxDropDownList").val('New Value');
|