Properties

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'); 
Try it: autoOpen is set to true
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'); 
Try it: autoItemsHeight is set to true
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'); 
Try it: autoDropDownHeight is set to true
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'); 
Try it: animationType is set to 'fade'
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'); 
Try it: checkboxes is set to true
closeDelay Number 400

Sets or gets the delay of the 'close' animation.

Code example

Set the closcloseDelayDelay property

$('#jqxDropDownList').jqxDropDownList({closeDelay: 200});
                        

Get the closeDelay property.

var closeDelay = $('#jqxDropDownList').jqxDropDownList('closeDelay'); 
Try it: closeDelay is set to 2000
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');
Try it: disabled is set to true
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'); 
Try it: displayMember is set to 'text'
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'); 
Try it: dropDownHorizontalAlignment is set to 'right'
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');
Try it: dropDownVerticalAlignment is set to "top"
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'); 
Try it: dropDownHeight is set to 200
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'); 
Try it: dropDownWidth is set to 210
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'); 
Try it: enableSelection is set to false
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'); 
Try it: enableBrowserBoundsDetection is set to true
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'); 
Try it: enableHover is set to false
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'); 
Try it: filterable is set to true
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'); 
Try it: filterHeight is set to 30
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'); 
Try it: filterDelay is set to 300
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'); 
Try it: filterPlaceHolder is set to "Filtering..."
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');
Try it: height is set to 20
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'); 
Try it: incrementalSearch is set to false
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'); 
Try it: incrementalSearchDelay is set to 100
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'); 
Try it: itemHeight is set to 30
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'); 
Try it: openDelay is set to 2000
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'); 
Try it: promptText is set to 'Select'
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'); 
Try it: popupZIndex is set to 9999
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'); 
Try it: rtl is set to true
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'); 
Try it: renderer is set to a custom rendering function
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'); 
Try it: selectionRenderer is set to a custom rendering function
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'); 
Try it: searchMode is set to 'startswithignorecase'
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'); 
Try it: scrollBarSize is set to 10
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'); 
Try it: source is set to 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'); 
Try it: selectedIndex is set to 3
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');
Try it: template is set to 'success'
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:
  • Include the theme's CSS file after jqx.base.css.
    The following code example adds the 'energyblue' theme.
    
    
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.energyblue.css" type="text/css" />
    
  • Set the widget's theme property to 'energyblue' when you initialize it.
Try it: theme is set to 'energyblue'
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'); 
Try it: valueMember is set to 'value'
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');
Try it: width is set to 200

Events

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) { });
Try it: Bind to the bindingComplete event by type:jqxDropDownList
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. });
                        
Try it: Bind to the close event by type:jqxDropDownList
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.
Try it: Bind to the checkChange event by type:jqxDropDownList
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.
Try it: Bind to the change event by type:jqxDropDownList
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. }); 
Try it: Bind to the open event by type:jqxDropDownList
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.
Try it: Bind to the select event by type:jqxDropDownList
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.
Try it: Bind to the unselect event by type:jqxDropDownList

Methods

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'} ); 
Try it: adds an item in the jqxDropDownList
clearSelection Method

Clears all selected items.

Parameter Type Description
None
Return Value
None

Code example

Invoke the clearSelection method.

$("#jqxDropDownList").jqxDropDownList('clearSelection'); 
Try it: clears the selection in the jqxDropDownList
clear Method

Clears all items.

Parameter Type Description
None
Return Value
None

Code example

Invoke the clear method.

$("#jqxDropDownList").jqxDropDownList('clear'); 
Try it: clears all items in the jqxDropDownList
close Method

Hides the popup listbox.

Parameter Type Description
None
Return Value
None

Code example

Invoke the close method.

$("#jqxDropDownList").jqxDropDownList("close" ); 
Try it: closes the jqxDropDownList
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); 
Try it: checks a box in the jqxDropDownList
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.
Try it: checks an item in the jqxDropDownList
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'); 
Try it: checks all of the items in the jqxDropDownList
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'); 
Try it: clears the jqxDropDownList's Filter.
destroy Method

Destroys the widget.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the destroy method.

$('#jqxDropDownList').jqxDropDownList('destroy'); 
Try it: destroys the jqxDropDownList
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" ); 
Try it: disables an item in the jqxDropDownList
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 ); 
Try it: disables an item in the jqxDropDownList
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" ); 
Try it: enables an item in the jqxDropDownList
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 ); 
Try it: enables an item in the jqxDropDownList
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 ); 
Try it: ensures the visibility of an items in the jqxDropDownList
focus Method

Sets the focus to the widget.

Parameter Type Description
None
Return Value
None

Code example

Invoke the focus method.

$("#jqxDropDownList").jqxDropDownList('focus');
Try it: focuses the jqxDropDownList
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 ); 
Try it: gets the an items by its index in the jqxDropDownList
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'");
Try it: gets the an items by its value in the jqxDropDownList
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];
Try it: returns an Array of all items and displays the first 2 of them
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'); 
Try it: returns an Array of all checked items and displays first 2 of them
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'); 
Try it: returns the selected item and displays it
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'); 
Try it: returns the selected item's index and displays it
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 ); 
Try it: inserts an item in the jqxDropDownList
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' ); 
Try it: check whether the jqxDropDownList is opened
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); 
Try it: indeterminate a box in the jqxDropDownList
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.
Try it: indeterminate an item in the jqxDropDownList
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>
Try it: loads list items from a 'select' tag.
open Method

Shows the popup listbox.

Parameter Type Description
None
Return Value
None

Code example

Invoke the open method.

$("#jqxDropDownList").jqxDropDownList('open' ); 
Try it: opens the jqxDropDownList
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" ); 
Try it: removes an item in the jqxDropDownList
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 ); 
Try it: removes an item in the jqxDropDownList
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 ); 
Try it: select an item by its index in the jqxDropDownList
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.
Try it: select an item in the jqxDropDownList
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'); 
Try it: sets the content in the jqxDropDownList
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");
Try it: updates an item in the jqxDropDownList
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 );
Try it: updates an item in the jqxDropDownList
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 ); 
Try it: unselect an item by its index in the jqxDropDownList
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.
Try it: unselect an item in the jqxDropDownList
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); 
Try it: unchecks a box in the jqxDropDownList
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.
Try it: unchecks an item in the jqxDropDownList
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'); 
Try it: unchecks all of the items in the jqxDropDownList
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');
Try it: sets or gets the selected value in the jqxDropDownList