国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jquery easyui如何實(shí)現(xiàn)格式化列

2019-11-19 15:57:08
字體:
供稿:網(wǎng)友

本文主要介紹了jquery easyui如何實(shí)現(xiàn)格式化列 ,正好最近需要用到,分享給大家,也給自己留個(gè)筆記

主框架頁面: 在主界面區(qū)會加載西區(qū)菜單點(diǎn)擊的URL內(nèi)容.

<!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:''" style="height:80px;" id="north"></div>  <div data-options="region:'west',title:'系統(tǒng)功能區(qū)',split:true" style="width:200px;">    <ul class="easyui-tree" id="menu"></ul>  </div>  <div data-options="region:'center',title:'主界面區(qū)'" style="padding:5px;" id="center"></div></body></html>

此時(shí)在主頁面已經(jīng)加載了easy-ui的腳本和CSS ,在各區(qū)頁面就不必加載了,即使加載了也會被去掉.

我一開始在datagrid頁面添加格式化函數(shù),但是沒有效果,始終報(bào)找不到formatIsvalid這個(gè)函數(shù).

<!DOCTYPE html><html><head>  <meta charset="UTF-8"/>  <title>站點(diǎn)列表頁面</title>  <script type="text/javascript">  function formatIsvalid(val,row){    return val=='1'?'是':'否';  }  </script></head><body>  <table id="site" title="站點(diǎn)列表" 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">網(wǎng)址</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">創(chuàng)建時(shí)間</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>

解決辦法:把這個(gè)格式化函數(shù)放到主頁面中就沒有問題了.

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持武林網(wǎng)。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 惠安县| 平安县| 常宁市| 玉田县| 琼海市| 滁州市| 南和县| 红安县| 湟中县| 新河县| 中卫市| 宁安市| 吉水县| 石首市| 凤阳县| 论坛| 思茅市| 大竹县| 崇左市| 江山市| 翁牛特旗| 南岸区| 潜山县| 洞头县| 荔波县| 台安县| 永德县| 六盘水市| 特克斯县| 长海县| 大埔区| 谢通门县| 河东区| 托里县| 新邵县| 容城县| 大安市| 合作市| 泗阳县| 金溪县| 两当县|