概述
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<title>列表页面</title>
<#include "*/common/resources.inc.ftl">
<script type="text/javascript">
function doSearch() {
$('#dg').datagrid('load', $("#searchForm").serializeJSON());
}
function showAddDialog(){
var dlg = dialog({
title: '新建',
url: '${CONTEXT_PATH}/project/catalog/catalogDialog',
width: '810',
height: '438',
buttons: dialogDefaultHandler(doSave, function() {dlg.dialog('close');})
});
}
function showEditDialog(){
var row = $('#dg').datagrid('getSelected');
if (!row) {
top.$.messager.show({title:'消息', msg:'请选择要编辑的记录'});
return;
}
var dlg = dialog({
title: '编辑',
url: '${CONTEXT_PATH}/project/catalog/catalogDialog?id='+row.id,
width: '810',
height: '438',
buttons: dialogDefaultHandler(doSave, function() {dlg.dialog('close');})
});
}
function doSave() {
if (!top.$dw.$("#fm").form('validate')) {
return false;
}
var dc = top.$dw.$("#fm").serializeJSON();
$.post("${CONTEXT_PATH}/project/catalog/doSave", dc, function(response){
if (response.status<=0){
top.$.messager.alert('错误', response.message);
} else {
top.$.messager.show({title:'消息', msg:response.message});
top.$d.dialog('close');
$("#dg").datagrid('reload');
}
});
}
function doDelete() {
var row = $('#dg').datagrid('getSelected');
if (!row) {
top.$.messager.show({title:'消息', msg:'请选择要删除的记录'});
return;
}
top.$.messager.confirm('确认','确认删除?',function(r){
if (r) {
$.post('${CONTEXT_PATH}/project/catalog/doDelete', {id:row.id}, function(response){
top.$.messager.show({title:'消息', msg:response.message});
$('#dg').datagrid('reload');
});
}
});
}
</script>
</head>
<body>
<table id="dg" title="列表" class="easyui-datagrid" toolbar="#toolbar" url="${CONTEXT_PATH}/project/catalog/dgData" data-options="onDblClickRow:showEditDialog,checkOnSelect:false,selectOnCheck:false,toolbar:'#toolbarUser',onLoadSuccess:enableDndUser">
<thead>
<tr>
<!-- <th field="id" width="10" >id</th> -->
<th field="name" width="20" >栏目名称</th>
<th field="addUserName" width="10" >添加用户</th>
<th field="addTime" width="10" >添加时间</th>
</tr>
</thead>
</table>
</body>
</html>
<div id="toolbar">
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="l-btn-icon icon-add" plain="true" onclick="showAddDialog()">新建栏目</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="l-btn-icon icon-edit" plain="true" onclick="showEditDialog()">编辑栏目</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="l-btn-icon icon-remove" plain="true" onclick="doDelete()">删除栏目</a>
<form id="searchForm" style="float:right; margin-right:20px;">
<input name="keyword" class="easyui-searchbox" data-options="prompt:'请输入栏目名称',searcher:doSearch" style="width:180px" />
</form>
</div>
转载于:https://my.oschina.net/venju/blog/1929361
最后
以上就是积极小伙为你收集整理的index.ftl的全部内容,希望文章能够帮你解决index.ftl所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复