下面小編就為大家?guī)硪黄猨query ezUI 雙擊行記錄彈窗查看明細的實現(xiàn)方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。
第一步:給DataGrid綁定onDblClickRow事件;
<table title="" id="dataTable" class="easyui-datagrid" style="height: 500px;" data-options="
url: '/ajaxget.aspx?_t='+new Date().getTime()+'&_action=SVNGetHandler.GetSearchPageData&searchType=&keyword=*',
method: 'get',
rownumbers: true,
singleSelect:true,
border:0,
idField: 'Id',
columns:[[
{field:'ProjectId',title:'項目Id',width:30,align:'left'},
{field:'ProjectName',title:'項目名稱',width:150,align:'left'},
{field:'ProjectNum',title:'項目編號',width:100,align:'left'}
]],
toolbar:'#myToolbar',
pagination:true,
fitColumns: true,
pageSize:20,
onDblClickRow:onDblClickRow
">
</table>
第二步:編寫行雙擊事件
//行雙擊事件
function onDblClickRow() {
var item = $('#dataTable').datagrid("getSelected");
if (item != null) {
editId = item.Id;
var html = "";
html += "項目名稱:" + item.ProjectName + "<br/>";
html += "項目編號:" + item.ProjectNum + "<br/>";
html += "<br/>";
show(item.ProjectName + " 項目詳情", html);
}
}
第三步:彈出窗口顯示詳細信息:
<div id="details" style="padding: 10px;line-height:20px;font-size:12px"></div>
function show(title, msg) {
$('#details').html("<div id=\"output\" style=\"width:99%;height:96%;border:0\">" + msg + "</div>");
$('#details').dialog({
title: title,
width: 800,
height: 400,
iconCls: 'icon-custom-eye',
closed: false,
cache: false,
modal: true
});
}
以上這篇jquery ezUI 雙擊行記錄彈窗查看明細的實現(xiàn)方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考