jQuery UI Widgets › Forums › General Discussions › Lists › ComboBox › Data Binding Array
Tagged: jquery combobox, jQuery UI, jquery ui combobox, jQuery UI Widgets, jQuery Widgets, jqwidgets combobox, jqxComboBox Data Binding array
This topic contains 3 replies, has 3 voices, and was last updated by Peter Stoev 10 years ago.
-
AuthorData Binding Array Posts
-
What I want to do is bind an array with changing data to a combobox.
//dataadapter var column = new Array(); var sourceType = { localdata: column, datatype: "array", datafields: [ { name: 'TypeDeProtection', type: 'string' }, ] }; var dataAdapter2 = new $.jqx.dataAdapter(sourceType); $('#jqxComboBox4').jqxComboBox({source: dataAdapter2,displayMember: 'TypeDeProtection', multiSelect: true, theme :'energyblue', width:700}); //then I Change data $("#jqxComboBox").on('change', function (event) { var rows = $('#jqxgrid').jqxGrid('getdisplayrows'); for (var i = 0; i < rows.length; i++) { var rowData = rows[i]; data[i]=rows[i]['TypeDeProtection']; } for (var i = 0; i < data.length; i++) { var row = {}; row['TypeDeProtection'] =data[i]; column[i] = row; } });then how do I refresh data binding
this dosen’t work
$(‘#jqxComboBox4’).jqxComboBox(‘updatebounddata’);I would alo like to store selected items before ifd theuy are still there after data is reffresehd but What event should I use
Hi scarrier92,
There is no “updatebounddata” method in jqxComboBox so it would be strange if it had worked. To refresh the ComboBox’s data, the solution is to set it’s source property to point to new dataAdapter instance.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi,
Could you kindly let me know how this can be done specifically ?
My single-page application is having 10+ comboboxes pointing to a single local array (backed by a data adapter) as data source.
Regularly the data in this array will be refreshed and updated from the server, and I want all the linked comboboxes to have the source data updated.
Please kindly let me know how this can be achieved.
Thank you very much !
Hi solobobo,
As I wrote in the previous post, you need to set the “source” property to update the widget’s data source.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.