Hi, guys!
How can I set preselected item on ListBox with dataAdapter?
1st situation: only source
var source_jqx_listbox_year = [ "2012", "2013"];$("#jqxListBoxYear").jqxListBox({ source: source_jqx_listbox_year, width: 700, height: 48, theme: '' });$("#jqxListBoxYear").jqxListBox('selectIndex', 0);
Here the cursor is located on 1st item.
2nd situation: dataAdapted instead of source
var source_jqx_listbox_quarter = { datatype: "tab", datafields: [ { name: 'quarter_name'}, { name: 'quarter_digit'} ], url: '../../quarters.txt' };dataAdapter_jqx_listbox_quarter = new $.jqx.dataAdapter(source_jqx_listbox_quarter);$("#jqxListBoxQuarter").jqxListBox({ source: dataAdapter_jqx_listbox_quarter, displayMember: "quarter_name", valueMember: "quarter_digit", width: 700, height: 96, theme: '' });$("#jqxListBoxQuarter").jqxListBox('selectIndex', 2 );quarters.txt:QUARTER_1 1QUARTER_2 2QUARTER_3 3QUARTER_4 4
Why here cursor is not set on 3rd item? And how can I preselect it?