Hi Michael,
Thanks for using Syncfusion Forum.
Query: I'm struggling with a table that has a dropdown-field to select from one of three pre-defined values.
In order to render the grid column as a dropdown while editing we suggest you to define editType as Dropdown which will render the dropDownList with the grid column dataSource Or If you want to bind the external dataSource to the dropdown column we suggest you to use the dataSource property of column.
We need to define the dropdown data value as text and value pair. So, either we can define the dataSource list as text and value pair Or we can define the fields for that column using editParams property. As like below code example.
Query: only first cell is shown in the attached sample
To avoid the reported issue we suggest you to define the fields in Grid dataSource without space. Kindly remove the white space for fields definition in your sample.
Code
<body>
<div id="myGrid"></div>
<script type="text/javascript">
var fieldTypes = [
{
"type": "media"
}
……
];
$(function() {
$("#myGrid").ejGrid({
"columns": [
…………. . .
{
"dataSource": fieldTypes, //define the external dataSource for dropdown column here
"editType": ej.Grid.EditingType.Dropdown,
"field":"type",
"editParams":{ fields: {text:"type",value:"type"} }, //define text and value pair to bind external dataSource to the field here
"headerText": "Type",
"isIdentity": false,
"isPrimaryKey": false
}],
dataSource: myGridData,
});
});
</script>
|
Output
Please refer to the below help documentation links,
Note: In your sample you have used dropdownData in the column definition but we don’t have such property in our Grid column definition so kindly remove it from the column definition. And as we said above, we have dataSource property to define the external dataSource for column.
Kindly revert us for further assistance on this.
Regards,
Gowri V L