这篇文章将为大家详细讲解有关jquery中easyui实现格式化列的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
主框架页面: 在主界面区会加载西区菜单点击的URL内容.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>主界面</title>
<div th:include="/public/util::public"/>
<div th:include="/public/util::jquery-easyui"/>
<script type="text/javascript" th:src="(${@configApp.getStaticWeb()})+'/cms/script/main/index.js'"></script>
<script type="text/javascript" th:src="(${@configApp.getStaticWeb()})+'/cms/script/site/site-index.js'"></script>
</head>
<body class="easyui-layout">
<div data-options="region:'north',title:''" id="north"></div>
<div data-options="region:'west',title:'系统功能区',split:true" >
<ul class="easyui-tree" id="menu"></ul>
</div>
<div data-options="region:'center',title:'主界面区'" id="center"></div>
</body>
</html>
此时在主页面已经加载了easy-ui的脚本和CSS ,在各区页面就不必加载了,即使加载了也会被去掉.
我一开始在datagrid页面添加格式化函数,但是没有效果,始终报找不到formatIsvalid这个函数.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>站点列表页面</title>
<script type="text/javascript">
function formatIsvalid(val,row){
return val=='1'?'是':'否';
}
</script>
</head>
<body>
<table id="site" title="站点列表" class="easyui-datagrid" th:url="@{/site/list}"
toolbar="#siteToolbar" rownumbers="true" fitColumns="true" singleSelect="true">
<thead>
<tr>
<th field="siteid" width="50">ID</th>
<th field="sitename" width="50">名称</th>
<th field="siteurl" width="50">网址</th>
<th field="isvalid" width="50" formatter="formatIsvalid">是否有效</th>
<th field="isdelete" width="50">是否可以删除</th>
<th field="remark" width="50">备注</th>
<th field="createtime" width="50">创建时间</th>
</tr>
</thead>
</table>
<div id="siteToolbar">
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newSite()">新增</a>
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editSite()">编辑</a>
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="removeSite()">删除</a>
</div>
</body>
</html>
解决办法:把这个格式化函数放到主页面中就没有问题了.
关于“jquery中easyui实现格式化列的方法”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。