[英]Grid Editing in shieldUI lite api
I have created a dynamic grid by using ShieldUI API and added dropdown boxes to each colunm. 我已经使用ShieldUI API创建了一个动态网格,并向每个库添加了下拉框。
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: 但是当我添加新行时,以前的行值被重置为null根据我的理解,这是因为下拉列表中的值未设置到现有网格中而发生的:
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 您可以查看以下示例: 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. 在这种情况下,它是一个组合,但是相同的逻辑适用于下拉菜单或任何其他小部件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.