I have created a dynamic grid by using ShieldUI API and added dropdown boxes to each colunm.
But when I am adding new row then previous rows values are being reset to null.According to my understanding this is happening because dropdown values are not being set into existing grid:
And when I am clicking on grid anywhere then the grid row is freezing and row values are retained.
I am using custom editor for dropdown like:
function subAccountCustomEditor(cell, item)
{
$('<div id="subAccount"/>')
.appendTo(cell)
.shieldDropDown({
dataSource: { data: [] },
value: !item["subAccount"] ? null : item["subAccount"].toString(),
textTemplate: "{value}",
valueTemplate: "{code}",
inputTemplate: "{value}"
}).swidget().focus();
}
You can check out the following example: http://demos.shieldui.com/web/grid-editing/editing-custom-editor
To see how to initialize a custom editor. In this case it is a combo, but the same logic is applicable for a drop-down or any other widget.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.