jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ListBox › Dynamic dataprovider for listbox › Reply To: Dynamic dataprovider for listbox
Peter,
Thanks for your reply.
The example with the jqxDataAdapter plug-inworks for me. Are there more docs on the adapter?
I am able to populate the listbox fine but I am having trouble with the syntax to retrieve the value of the selected item.
here is how i set up my data;
var url = “presMobile.xml”;
// prepare the data
var source =
{
datatype: “xml”,
datafields: [
{ name: ‘SlideName’, map: ‘Title’ },
{ name: ‘SlideTime’, map: ‘SlideTime’ },
],
root: “Slides”,
record: “Slide”,
url: url
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#ListBox”).jqxListBox({ source: dataAdapter, displayMember: “SlideName”, valueMember: “SlideTime”, width: 224, height: 590, theme: ‘midnight’ });
I want to retrieve the SlideTime value from the selected item like to use in a callback handler
$(‘#jqxListBox’).bind(‘select’, function (event) {
var args = event.args;
var item = $(‘#jqxListBox’).jqxListBox(‘getItem’, args.index);
// get and alert value
var item = item.value;
alert(event.data.SlideTime)
});
——————————————————————————————————-
Here is my xml
swf/slide1.swf
Slide 1
1
swf/slide2.swf
Case: TM
278
swf/slide3.swf
Criteria for Manic Episode
906
——————————————————————————————————
Any suggestions as to how to properly grab selected values with the jqxDataAdapter plug-in
in this context?
Thanks
Donaldo