62,266
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
$(function () {
$("#win").window('close', true);
$("#tab_select").datagrid({
url: '/admin/system/GetPageList/',
method: 'post',
width: 'auto',
height: 'auto',
loadMsg: '数据加载中...',
singleSelect: true,
fitColumns: true,
pagination: true,
striped: true,
rownumbers: true,
pageSize: 5,
pageList: [5, 10, 15],
toolbar: [{
iconCls: 'icon-edit',
text: '编辑',
handler: edit
}, '-', {
iconCls: 'icon-add',
text: '添加',
handler: add
}, '-', {
iconCls: 'icon-remove',
text: '删除',
handler: del
}],
onSelect: function (rowI, rowD) {
selectedRowIndex = rowI;//将选中行的下标 设置给全局变量
}
});
})
var selectedRowIndex = -1;
function add() {
$("#win").window({
title: "添加权限"
});
$("#win").window('open');
$.get("/admin/system/AddPermission/", function (returnStr) {
if (returnStr.Statu) {
$.procAjaxData(returnStr);
}
else {
$("#win").html(returnStr);
}
});
}
function edit() {
//$("#win").window({
// title: "编辑权限"
//});
var $select = $("#tab_select").datagrid("getSelected");
if ($select) {
$("#win").window('open');
$.get("/admin/system/EditPermission/" + $select.pid, null, function (returnStr) {
if (returnStr.Statu) {
$.procAjaxData(returnStr);
}
else {
$("#win").html(returnStr);
$.parser.parse($("#win"));
}
});
}
}
<table id="tab_select" class="easyui-datagrid">
<thead>
<tr>
<th data-options="field:'pid'">权限标识</th>
<th data-options="field:'pName'">名称</th>
<th data-options="field:'pAreaName'">区域</th>
<th data-options="field:'pControllerName'">控制器</th>
<th data-options="field:'pActionName'">方法</th>
<th data-options="field:'pMethod',formatter:methodformat">请求方式</th>
</tr>
</thead>
<tbody>
</table>
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'center'"></div>
</div>
<div id="win" class="easyui-window" title="My Window" style="width: 600px; height: 400px"
data-options="iconCls:'icon-save',modal:true">
</div>
