- 注册时间
- 2015-11-10
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 28
- 精华
- 0
- 帖子
- 4
|
本帖最后由 jiangrf 于 2015-11-11 11:02 编辑
felt 发表于 2015-11-11 09:26
grid.updateRow(row,{field:value})
获取数据,自己去填充
是这样的,比如我点击采购商品名称旁边的省略号按钮,跳出选择列表。双击弹出框中的某一行,如何将车型名称同时填入采购商品ID,和采购商品名称。求大神帮帮忙。万分感谢。
【jsp】
<fieldset>
<legend style="color: #F7855D;font-weight:bold;">采购信息</legend>
<div id="datagrid_purchaseDetail" class="mini-datagrid"
style="width:100%;height:120px; " borderStyle="border:0;"
url="${ctx}/purchaseDetail/itemList.action" idField="id"
sortField="productId" allowAlternating="true"
pageSize="20" allowCellEdit="true" allowCellSelect="true"
editNextOnEnterKey="true"
editNextRowCell="true">
<div property="columns">
<div field="productId" headerAlign="center">采购商品ID
</div>
<div field="productName" headerAlign="center" >采购商品名称
<input property="editor" id="btnEdit1" class="mini-buttonedit"
onbuttonclick="onButtonEdit"/>
</div>
<div field="carModelId" headerAlign="center" >车型ID</div>
<div field="carModelName" headerAlign="center" >车型详细</div>
<div field="carYear" headerAlign="center" >车型年款</div>
<div field="quantity" headerAlign="center" >数量</div>
<div field="type" headerAlign="center" renderer="onTypesRenderer">订单类型</div>
<div field="price" headerAlign="center" dataType="currency" currencyUnit="¥">单价</div>
<div field="amount" headerAlign="center" dataType="currency" currencyUnit="¥">小计</div>
</div>
</div>
</filedset>
【js】
function onButtonEdit(e) {
var btnEdit = this;
var grid = e.sender;
var record = e.record;
mini.open({
url : "${ctx}/model/ref.action",
title : "选择列表",
width : 600,
height : 550,
ondestroy : function(action) {
// if (action == "close") return false;
if (action == "ok") {
var iframe = this.getIFrameEl();
var data = iframe.contentWindow.GetData();
data = mini.clone(data); // 必须
if (data) {
btnEdit.setValue(data.name);
grid.updateRow(record,{"productId":data.name})
}
}
}
});
}
|
|