最近困惑我,关于dialog内容值返回,我在easy ui的datagridview的单元格onclickcell事件里写了一个弹窗dialog,在这个dialog中放了一个文本,要实现把这个dialog文本中输入的内容提交给原来单击的这个单元格,然后dialog关闭,现在这个单元格并不显示我保存的内容,想问怎样实现显示?
$('#tt').datagrid({
iconCls: 'icon-edit',
onClickCell: onClickCell, //单击单元格的函数,在这声明
columns: [[
{ field: 'seq_no', title: '序号', width: 80, sortable: true, hidden: true },
{ field: 'draw_name', title: '名称', width: 80, align: 'center', sortable: true },
{field: 'requirement', title: '技术要求', width: 160, align: 'center'}
]],
});
<div id="dlg-buttons1">
<a href="#" class="easyui-linkbutton" onclick="returnValue()" iconcls="icon-save">提交</a>
</div>
function onClickCell(rowIndex,field,value){
if (field == "requirement"){
$("#edit_notedel").dialog("open").dialog('setTitle', '详情编辑'); //弹出详情编辑对话框openDlg();
}
}
function returnValue() {
var note = $('#reasondel').val();//获取dialog的内容
// 得到rows对象
var rows = $('#tt').datagrid("getSelected");
rows.requirement = note;//将值赋给该行的那个单元格字段
$("#edit_notedel").dialog("close");
$('#reasondel').val('');
//这样dialog关闭后,原编辑的单元格不能显示dialog中编辑的,想怎么实现?
}