Hi Dimitri,
You can define the ComboBox’s source by setting its value and label members. The label member represents the display string.
Here’s how to bind the ComboBox and create its source object:
var source = [ {value: "key1", label: "Label1"}, {value: "key2", label: "Label2"}, {value: "key3", label: "Label3"}, {value: "key4", label: "Label4"}, ]; // Create a jqxComboBox $("#jqxComboBox").jqxComboBox({ source: source, width: '200px', height: '25px'});
Then to get the selected value, you can bind to the ‘select’ event and call the ‘getitem’ method. The method retrieves a ComboBox item that has value and label properties.
For example:
$('#jqxComboBox').bind('select', function (event) { var args = event.args; var item = $('#jqxComboBox').jqxComboBox('getItem', args.index); // get value. var value = item.value; // get label. var label = item.label; });
Best Regards,
Ivan Penev
jQWidgets Team
http://www.jqwidgets.com