增加新增、编辑、删除事件

This commit is contained in:
shuzheng 2017-02-14 21:57:21 +08:00
parent 17c6e3b826
commit a1fb2a7999
7 changed files with 121 additions and 113 deletions

View File

@ -22,9 +22,9 @@
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:organization:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增组织</a></shiro:hasPermission>
<shiro:hasPermission name="upms:organization:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑组织</a></shiro:hasPermission>
<shiro:hasPermission name="upms:organization:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除组织</a></shiro:hasPermission>
<shiro:hasPermission name="upms:organization:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增组织</a></shiro:hasPermission>
<shiro:hasPermission name="upms:organization:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑组织</a></shiro:hasPermission>
<shiro:hasPermission name="upms:organization:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除组织</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
@ -73,21 +73,22 @@ $(function() {
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
'<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 新增
function createAction() {
}
// 编辑
function updateAction() {
var rows = $table.bootstrapTable('getSelections');
}
// 删除
function deleteAction() {
var rows = $table.bootstrapTable('getSelections');
}
</script>
</body>
</html>

View File

@ -22,9 +22,9 @@
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
@ -79,8 +79,8 @@ $(function() {
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
'<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
@ -105,17 +105,18 @@ function statusFormatter(value, row, index) {
return '<span class="label label-danger">锁定</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 新增
function createAction() {
}
// 编辑
function updateAction() {
var rows = $table.bootstrapTable('getSelections');
}
// 删除
function deleteAction() {
var rows = $table.bootstrapTable('getSelections');
}
</script>
</body>
</html>

View File

@ -22,9 +22,9 @@
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
@ -79,8 +79,8 @@ $(function() {
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
'<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
@ -105,17 +105,18 @@ function statusFormatter(value, row, index) {
return '<span class="label label-danger">锁定</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 新增
function createAction() {
}
// 编辑
function updateAction() {
var rows = $table.bootstrapTable('getSelections');
}
// 删除
function deleteAction() {
var rows = $table.bootstrapTable('getSelections');
}
</script>
</body>
</html>

View File

@ -22,9 +22,9 @@
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑权限</a></shiro:hasPermission>
<shiro:hasPermission name="upms:permission:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除权限</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
@ -79,8 +79,8 @@ $(function() {
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
'<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
@ -105,17 +105,18 @@ function statusFormatter(value, row, index) {
return '<span class="label label-danger">锁定</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 新增
function createAction() {
}
// 编辑
function updateAction() {
var rows = $table.bootstrapTable('getSelections');
}
// 删除
function deleteAction() {
var rows = $table.bootstrapTable('getSelections');
}
</script>
</body>
</html>

View File

@ -22,9 +22,9 @@
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:role:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增角色</a></shiro:hasPermission>
<shiro:hasPermission name="upms:role:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑角色</a></shiro:hasPermission>
<shiro:hasPermission name="upms:role:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除角色</a></shiro:hasPermission>
<shiro:hasPermission name="upms:role:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增角色</a></shiro:hasPermission>
<shiro:hasPermission name="upms:role:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑角色</a></shiro:hasPermission>
<shiro:hasPermission name="upms:role:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除角色</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
@ -73,21 +73,22 @@ $(function() {
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
'<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 新增
function createAction() {
}
// 编辑
function updateAction() {
var rows = $table.bootstrapTable('getSelections');
}
// 删除
function deleteAction() {
var rows = $table.bootstrapTable('getSelections');
}
</script>
</body>
</html>

View File

@ -22,9 +22,9 @@
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:system:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增系统</a></shiro:hasPermission>
<shiro:hasPermission name="upms:system:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑系统</a></shiro:hasPermission>
<shiro:hasPermission name="upms:system:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除系统</a></shiro:hasPermission>
<shiro:hasPermission name="upms:system:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增系统</a></shiro:hasPermission>
<shiro:hasPermission name="upms:system:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑系统</a></shiro:hasPermission>
<shiro:hasPermission name="upms:system:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除系统</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
@ -35,9 +35,10 @@
<script src="${basePath}/resources/zheng-ui/plugins/waves-0.7.5/waves.min.js"></script>
<script src="${basePath}/resources/zheng-ui/js/common.js"></script>
<script>
var $table = $('#table');
$(function() {
// bootstrap table初始化
$('#table').bootstrapTable({
$table.bootstrapTable({
url: '${basePath}/manage/system/list',
height: getHeight(),
striped: true,
@ -76,8 +77,8 @@ $(function() {
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
'<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
@ -92,17 +93,18 @@ function statusFormatter(value, row, index) {
return '<span class="label label-danger">锁定</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 新增
function createAction() {
}
// 编辑
function updateAction() {
var rows = $table.bootstrapTable('getSelections');
}
// 删除
function deleteAction() {
var rows = $table.bootstrapTable('getSelections');
}
</script>
</body>
</html>

View File

@ -22,9 +22,9 @@
<body>
<div id="main">
<div id="toolbar">
<shiro:hasPermission name="upms:user:create"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-plus"></i> 新增用户</a></shiro:hasPermission>
<shiro:hasPermission name="upms:user:update"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-edit"></i> 编辑用户</a></shiro:hasPermission>
<shiro:hasPermission name="upms:user:delete"><a class="waves-effect waves-button" href="javascript:;"><i class="zmdi zmdi-close"></i> 删除用户</a></shiro:hasPermission>
<shiro:hasPermission name="upms:user:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增用户</a></shiro:hasPermission>
<shiro:hasPermission name="upms:user:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑用户</a></shiro:hasPermission>
<shiro:hasPermission name="upms:user:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除用户</a></shiro:hasPermission>
</div>
<table id="table"></table>
</div>
@ -78,8 +78,8 @@ $(function() {
// 格式化操作按钮
function actionFormatter(value, row, index) {
return [
'<a class="update" href="javascript:void(0)" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:void(0)" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
'<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="Edit"><i class="glyphicon glyphicon-edit"></i></a> ',
'<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="Remove"><i class="glyphicon glyphicon-remove"></i></a>'
].join('');
}
// 格式化图标
@ -104,17 +104,18 @@ function statusFormatter(value, row, index) {
return '<span class="label label-success">正常</span>';
}
}
// 操作按钮事件
window.actionEvents = {
'click .update': function (e, value, row, index) {
alert('You click update icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .delete': function (e, value, row, index) {
alert('You click delete icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
// 新增
function createAction() {
}
// 编辑
function updateAction() {
var rows = $table.bootstrapTable('getSelections');
}
// 删除
function deleteAction() {
var rows = $table.bootstrapTable('getSelections');
}
</script>
</body>
</html>