jQuery UI Widgets › Forums › Grid › Dropdown list in gridcell after doubleclick, not showing
Tagged: grid dropdownlist
This topic contains 1 reply, has 2 voices, and was last updated by Hristo 5 years, 4 months ago.
-
Author
-
Hi, we have implemented a DropDownlist for a column (cell value) in a grid. The grid shows us the records of customers, the cell contains a CountryCode. Before we show the grid, the CountryName (from another table) is fetched and shown instead of the CountryCode from a linked dataAdapter.
No problems so far. On double-click in the cell, we want to offer our users the possibility to change the country from a DropDownlist.
The data for this list is correctly loaded, but for some reason, when clicked on, the list is not shown. You can select another value but keeps the height of the current cell. What are we missing?!DataAdapter for the country list:
this.countriesData = {
async: false,
datatype: ‘json’,
type: ‘GET’,
id: ”,
root: ‘data’,
datafields: [
{ name: ‘label’, type: ‘string’ },
{ name: ‘value’, type: ‘string’ }
],
loadallrecords: true,
url:api/countries
,
beforeprocessing: function (data) {
},
}
this.countriesDataAdapter = new jqx.dataAdapter(this.countriesData, {
autoBind: true
});Column configuration for country field:
createGridEditor: async function(row, cellvalue, editor, celltext, width, height) {
let displayMember = ‘label’
let valueMember = ‘value’
editor.jqxDropDownList({ autoDropDownHeight: true, displayMember: displayMember, valueMember: valueMember,
source: this.getEditorDataAdapter() })
}
},
cellValueChanging: function(row, column, columntype, oldvalue, newvalue) {
// return the old value, if the new value is empty.
if (newvalue == ”) return oldvalue;
},
initGridEditor: function(row, cellvalue, editor, celltext, pressedkey) {
// set the editor’s current value. The callback is called each time the editor is displayed.
var items = editor.jqxDropDownList(‘selectItem’, cellvalue);
},
gridEditorValue: function(row, cellvalue, editor) {
// return the editor’s value.
return editor.val();
},
getEditorDataAdapter: function() {
let dataAdapter = this.countriesDataAdapter
return dataAdapter
},Hello TMA,
I would like to ask you for a jseditor or jsfiddle example.
In that way, we could reproduce it.
You could create it with dummy records.
Also, I would like to mention that I saw you use theasync
option, please, try without it.
One more thing, I would like to suggest you look at this demo.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.