Sometimes when i run my page my list box only shows:
Please Choose:
It doesn’t have my json list of values inside it.
Other times it brings back my list – but always defaulting to the first item in my list – not the Please Choose: which isn’t in my list at all.
Any ideas? Code below:
$(document).ready(function () {
var theme = getDemoTheme();
// prepare the data
var source =
{
datatype: “json”,
datafields: [
{ name: ‘CompanyName’},
{ name: ‘ContactName’}
],
url: ‘data.php’,
async: false
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#dropdownlist”).jqxDropDownList(
{
source: dataAdapter,
theme: theme,
width: 250,
height: 25,
selectedIndex: 0,
displayMember: ‘ContactName’,
valueMember: ‘CompanyName’
});
$(‘#sendButton’).jqxButton({ width: 70, theme: theme });
});
thanks
Simon