jQWidgets Forums
jQuery UI Widgets › Forums › Grid › How to get combo box selected value and text which is in a Grid
This topic contains 4 replies, has 3 voices, and was last updated by crballon 9 years ago.
-
Author
-
Binding the data to the combo box and jqxgrid , now I want to get the selected value of combo box
Thanks,
J Sampath Kumar
Hi,
The ComboBox has a method called “getSelectedItem”. You can learn how to use it here: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxcombobox/jquery-combobox-api.htm.
The Grid raises the edit column’s “createeditor” when an editor is constructed and “initeditor” callback each time an editor is opened. By using these callbacks you can customize the ComboBox editor, get or set its properties, etc.{ text: 'Product', columntype: 'combobox', datafield: 'productname', width: 177, createeditor: function (row, cellvalue, editor) { var dataSource = ['Cappuccino', 'Caramel Latte', 'Caffe Espresso']; editor.jqxComboBox({source: dataSource }); }}
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThank you peter, for answering
How to bind the select function to dropdown list in a jqgrid
I have tried this
text: 'Charge Frequency', columntype: 'dropdownlist', displayfield: 'ChargeFrequency', datafield: 'ChargeFrequencyId', width: 150, createeditor: function (row, value, editor) { editor.jqxDropDownList({ source: FrequencyDataAdapter, displayMember: 'FrequencyName', valueMember: 'FrequencyId', id: 'ddlFrequency' }); $('#jqxDropDownList').on('select', function (event) { debugger; var args = event.args; if (args) { // index represents the item's index. var index = args.index; var item = args.item; // get item's label and value. var label = item.label; var value = item.value; } }); }
this not working…..
Mainly I want to get the value of the drop down list when it is change in a grid .
Presently I’m able to get the label but not value of the drop down
Thanks,
J Sampath KumarI got the solution for this
by using below code
editor.on('select', function (event) { var args = event.args; if (args) { var item = args.item; selChargeFequencyId = item.value; } });
hello sampath, i have the same problem, help me
-
AuthorPosts
You must be logged in to reply to this topic.