Closed zulq closed 3 years ago
Hi zulq,
If a function is specified for ctrlOptions
, AppendGrid
will expect the options are added manually (and ready to use) by it.
So, options are not generated in your case. Alternatively, you can get your options first and initialize AppendGrid
after that. For example:
// Get select options first
$.getJSON("GetSampleDefinitions").done(function (data) {
// Implement the `generateOptions` function to convert server response to AppendGrid supported option style
// Ref: http://appendgrid.apphb.com/Documentation#link-ctrlOptions
var dropDownOptions = generateOptions(data);
var sampleDetailsGrid = new AppendGrid({
columns: [
{
name: "sampleDef",
display: "Sample Definition (Water,Salt etc)",
type: "select",
ctrlOptions: dropDownOptions
},
...
});
});
Hope it can help. Thanks for using AppendGrid
!
@hkalbertl options are generated but after the data was already loaded. I've resolved it anyway, thanks.
Using appendgrid with drop down in one of the columns. However when I load existing data for edit, the existing options are not selected. Below is my code: