Hi,
Sorry if I missed this in the docs but when I load a grid with a dropdownlist in one column the drop down list is not displayed until the cell is clicked. How do you make the default behavior show the dropdownlist when the grid is loaded?
Here is some demo code:
<script type=”text/javascript”>
$(document).ready(function () {
var data =
[
{CompanyName : ‘big co’, ContactName : ‘big boss’ },
{CompanyName : ‘little co’, ContactName : ‘little boss’ }
];
var dd_data =
[
{id : ‘1’, name : ‘Lavazza’ },
{id : ‘2’, name : ‘Nescafe’ }
];
var source =
{
localdata: data,
datatype: “array”
};
var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$(“#jqxgrid”).jqxGrid(
{
source: dataAdapter,
editable: true,
columns: [
{ text: ‘Company Name’, datafield: ‘CompanyName’, width: 100 },
{ text: ‘Contact Name’, datafield: ‘ContactName’, width: 100 },
{ text: ‘Coffee’, width: 100, columntype: “dropdownlist”, initeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight)
{
editor.jqxDropDownList({ source: dd_data, displayMember: ‘name’, valueMember: ‘id’, selectedIndex: 0 });
}
}
]
});
});
</script>
<body class=’default’>
<div id=’jqxgrid’>
</div>
<div style=”font-size: 12px; font-family: Verdana;” id=”selectionlog”>
</div>
</body>
Any help would be gratefully received.
Regards,
Scott