Hi,
I am attempting to pre-select a value in a drop down list box, and cant get it to work (select item ‘Medical’). The drop down works, has all the values including ‘Medical’ and after I select I see the correct value, but I can not get it to pre-select. Please see the code below.
var source =
{
datatype: “json”,
datafields: [
{ name: ‘mtEventCodeName’, type: ‘string’}
],
url: ‘data_event_code.php’,
cache: false
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#jqxDropDownList”).jqxDropDownList(
{
source: dataAdapter,
theme: ‘classic’,
width: 150,
height: 25,
displayMember: ‘mtEventCodeName’,
valueMember: ‘mtEventCodeName’
});
$(“#jqxDropDownList”).jqxDropDownList(‘selectItem’, ‘Medical’);
$(‘#jqxDropDownList’).bind(‘select’, function (event) {
var args = event.args;
var item = $(‘#jqxDropDownList’).jqxDropDownList(‘getItem’, args.index);
document.getElementById(‘mteventcode’).value=item.label ;
});
Thank you,