Hi,
I would like to access the records in my dataadpater. The adapter is using json and I am binding the adaptor.
However, <adaptor>.records; returns an empty array.
Though the adaptor populates the Combobox widget properly right after.
The final goal is to be able to set the selectedIndex based on the PublisherId number set separately, so I need to verify the id exists in the dataapater and what position it is in before moving on to the next step of the page.
Thanks,
nja
var publisherSource =
{
datatype: "json",
datafields: [
{ name: 'PublisherLongName' },
{ name: 'PublisherId' }
],
url: '/Publications/PublisherDDL/'
};
var publisherAdapter = new $.jqx.dataAdapter(publisherSource);
publisherAdapter.dataBind();
var recordi = publisherAdapter.records;
console.log(recordi);
// recordi is always empty!
// but ComboBox is working fine
$("#publisher").jqxComboBox(
{
source: publisherAdapter,
width: 280,
height: 25,
autoItemsHeight: true,
autoDropDownHeight: true,
promptText: "Select publisher...",
displayMember: 'PublisherLongName',
valueMember: 'PublisherId',
theme: theme,
searchMode: 'contains',
selectedIndex: 0 // testing select
});