Hello,
I have a grid with a drop-down, which is populating properly only as long as I hard-code the values for the drop down in a local array. If I load the data from a server, the drop down does not bind properly. Here is a simple plunker to illustrate:
http://plnkr.co/edit/DWaaHGVAS6YuDcqTXPL8
I load the categories (the data source for the drop down) via setTimeout to "simulate" an async ajax call:
As you can see in the plunker, the category field shows the value instead of the text, and the drop down does not work.
If you simply remove the setTimeout and just populate the categories directly, everything works fine.
How can I make it work without having to hard-code the values?
Also, it appears the names "value" and "text" are required. Can this be set, so that other names can be used for these properties?
Thanks,
Lars
I have a grid with a drop-down, which is populating properly only as long as I hard-code the values for the drop down in a local array. If I load the data from a server, the drop down does not bind properly. Here is a simple plunker to illustrate:
http://plnkr.co/edit/DWaaHGVAS6YuDcqTXPL8
I load the categories (the data source for the drop down) via setTimeout to "simulate" an async ajax call:
var categories = []; setTimeout(function() { categories = [{ "value": 1, "text": "Beverages" },{ "value": 2, "text": "Condiments" },{ "value": 3, "text": "Confections" }]; $('#grid').data('kendoGrid').dataSource.read(); $('#grid').data('kendoGrid').refresh(); }, 100);As you can see in the plunker, the category field shows the value instead of the text, and the drop down does not work.
If you simply remove the setTimeout and just populate the categories directly, everything works fine.
How can I make it work without having to hard-code the values?
Also, it appears the names "value" and "text" are required. Can this be set, so that other names can be used for these properties?
Thanks,
Lars