<script>
var InfoDataGrid;
$(function() {
InfoDataGrid =$('#InfoDataGrid').datagrid({
url :'',
striped :true,
rownumbers :true,
pagination :true,
singleSelect:false,
idField :'id',
sortName :'id',
sortOrder :'desc',
pageSize :20,
pageList : [10, 20, 30, 40, 50, 100, 200, 300, 400, 500 ],
columns : [ [ {
width :'40',
field :'id',
checkbox:true
},{
width :'120',
title :'编码',
field :'code',
sortable :true
}]],
toolbar :'#Toolbar'
});
InfoDataGrid.datagrid({
onRowContextMenu:function (e, rowIndex, rowData) {
e.preventDefault();
$(this).datagrid('clearSelections');
$(this).datagrid("selectRow", rowIndex);
$('#menu').menu('show', {
left: e.pageX,
top: e.pageY
});
var t = e.target, field =$(t).closest('td').attr('field');
e.preventDefault();
$('#field').val(field);
}
});
});
</script>
<div id="menu" class="easyui-menu" style="width:30px; display:none;">
<input id="field" name="field" type="hidden"/>
<div id="btn_More" data-options="iconCls:'fa fa-clone'" onclick="copyInfo()">复制单元格</div>
</div>
网友评论