jQWidgets Forums
jQuery UI Widgets › Forums › Grid › JqxComboBox displaying valuemember on select inside of JqxGrid
Tagged: grid
This topic contains 6 replies, has 2 voices, and was last updated by Stanislav 7 years, 2 months ago.
-
Author
-
I have a jqxGrid, in that one of the columntype is combobox like so
//prepare the data //prepare the data var source_grid = { datatype: 'json', url: '/admin/fetch_data/grid/8' }; var dataAdapter_grid = new $.jqx.dataAdapter(source_grid); $("#jqxgrid").jqxGrid( { source: dataAdapter_grid, theme: 'classic', width:"100%", autoheight : 'auto', columns: [ { text: 'Table Name', datafield: 'table_name', width: 150 }, { text: 'Column Name', datafield: 'column_name', width: 150 }, { text: 'Data Type', datafield: 'data_type', width: 150 }, { text: 'Input Type', datafield: 'input_type', width: 150, columntype: 'combobox', createeditor: function (row, column, editor) { createComboInsideGrid(editor); } }, { text: 'ContactName', datafield: 'ContactName', width: 150 } ] });
And the combobox creation is like so
function createComboInsideGrid(editor){ // prepare the data source_combo_grid = { datatype: "json", datafields: [ { name: 'value' }, { name: 'label' } ], cache: false, url: '/admin/fetch_data/combo_box/input_type' }; dataAdapter_combo_grid = new $.jqx.dataAdapter(source_combo_grid); combo_source_instance = editor.jqxComboBox({ source: dataAdapter_combo_grid, theme: 'classic', width: '100%', autoDropDownHeight : true, selectedIndex: 1, displayMember: 'label', valueMember: 'value' }); }
The combo box is coming correctly without issues. The problem is that, when I select any value,the selected values, valuemember gets set in the grid not the labelmember.
for example : [2,foo][3,bar]
foo and bar gets displayed correctly, but when I select the bar from the combo box , the value 3 gets set in the grid cell.Hello akram,
What version of jqWidgets are you using?
Also, have you seen our demo on jqxComboBox Binding to JSON?Best Regards,
StanislavjQWidgets Team
http://www.jqwidgets.com/Using jqwidgets-ver5.6.0 version.
And yes, I have checked out that source. Still the same result.
What else could be the problem? Could it be because the jqxcombobox is inside of a grid?
Hello akram,
Can you build a small example of your case and send it to us?
It would greatly help us in resolving your issue.Best Regards,
StanislavjQWidgets Team
http://www.jqwidgets.com/I have added a working example of the problem which I have explained.
I have two combobox with same adapter and source yet behaves differently if the combo box is inside the grid or not.
If it is inside the grid, the valueMember gets displayed on select.
If it is stand-alone combo, the displayMembers shows up which is the correct behaviour.Can you please tell me what is wrong in the code, here is the link of the fiddle I created.
Any updates on the issue?
Hello akram,
Here is a working example, that when selecting an element from the combobox, returns its label and not the value.
ExampleBest Regards,
StanislavjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.