jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Probem getting dropdown field to fill in grid
Tagged: #jqwidgets-grid, grid, javascript grid, jquery grid
This topic contains 1 reply, has 2 voices, and was last updated by Hristo 7 years, 11 months ago.
-
Author
-
I am having a problem getting a dropdownlist field to fill upon loading a grid. Here is the code I am using:
$(“#jqxgrid”).jqxGrid(
{
width: ‘100%’,
source: griddataAdapter,
theme: ‘energyblue’,
pageable: true,
editable: true,
autoheight: true,
pagesize: 20,
columnsresize: true,
ready: function () {
$(‘#jqxgrid’).jqxGrid(‘autoresizecolumns’);},
columns: [
{ text: ‘Enterprise ID’, datafield: ‘Enterprise_ID’, editable: false, width: ‘10%’ },
{ text: ‘Enterprise Name’, datafield: ‘Name’ , width: ‘20%’ },
{
text: ‘Year Type’, datafield: ‘YearType_DID’, displayfield: ‘YearType’, columntype: ‘dropdownlist’, width: ‘20%’,
createeditor: function (row, value, editor) {
editor.jqxDropDownList({ source: ytdataAdapter, displayMember: ‘Name’, valueMember: ‘ItemOrder’ });
}
},
{ text: ‘Fiscal Year Begins’, datafield: ‘FiscalYearBegin’, cellsformat: ‘dd/MM/yyyy’, width: ‘15%’ },
{
text: ‘Benchmark Source’, datafield: ‘BenchmarkSource_DID’, displayfield: ‘Benchmark’, columntype: ‘dropdownlist’, width: ‘15%’,
createeditor: function (row, value, editor) {
editor.jqxDropDownList({ source: bmdataAdapter, displayMember: ‘Name’, valueMember: ‘ItemOrder’ });
}
},
{
text: ‘Refresh Rate’, datafield: ‘RefreshRate_DID’, displayfield: ‘Refresh’, columntype: ‘dropdownlist’, width: ‘10%’,
createeditor: function (row, value, editor) {
editor.jqxDropDownList({ source: rrdataAdapter, displayMember: ‘Name’, valueMember: ‘ItemOrder’ });
}
},
{
text: ‘Active’, datafield: ‘Active’, displayfield: ‘ActiveTxt’, columntype: ‘dropdownlist’, width: ‘5%’,
createeditor: function (row, value, editor) {
editor.jqxDropDownList({ source: actdataAdapter, displayMember: ‘Name’, valueMember: ‘ItemOrder’ });
}
},
{ text: ‘Chgd’, columntype: ‘checkbox’, width: ‘5%’ }
],
});The odd thing is that 2 of the dropdown lists are working while 2 or not. The ones that are not working are the ones where the text for the dropdown is longer than the column heading. You can click on the empty dropdown field and the dropdown appears, and select an option, and the field will populate – but it is not filling in on initial load
Hello tomintex,
The described behavior is strange your example looks fine.
Please, take a look at this demo:
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customizededitors.htm?light
In the example above is used almost the same approach and it seems to work fine.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.