- 注册时间
- 2014-3-25
- 最后登录
- 2014-4-29
- 阅读权限
- 10
- 积分
- 128
- 精华
- 0
- 帖子
- 35
|
我的datagrid有如下几列:
<div field="GID" displayfield="GID" name="GID">
物料编号
<input property="editor" class="mini-buttonedit" style="width: 100%" />
</div>
<div field="Name">物料名称</div>
<div field="Model">规格型号</div>
<div field="Unit">计量单位</div>
然后我的赋值js是:
function onButtonEdit(e) {
var btnEdit1 = e.sender;
mini.open({url: "/web/Storage/Goods/GoodsList.aspx",title: "请选择数据!", width: 800,
height: 450,
ondestroy: function (action) {if (action == "ok") {
var iframe = this.getIFrameEl();
var data = iframe.contentWindow.returnValue;
var row = grid.getSelected();
for (var i = 0; i < data.length; i++) {
var newrow = {GID:data[i].GID,Name:data[i].Name,Model:data[i].Model,Unit:data[i].Unit}
if (i == 0)
grid.updateRow(row, newrow);
else
grid.addRow(newrow, grid.indexOf(row));
}
}
}
});
}
获取到的数据分别是:
newrow
{...}
GID: "WL-SD100-013"
Name: "不三入耳式低音耳机"
Model: "AX-002"
Unit: "PCS"
row
{...}
_id: 3
_uid: 3
_state: "added"
现在的问题是Name,Model,Unit都能正确的赋值,但GID总是空的,赋不上值,请问大家这是怎么回事呢?
|
|