>  기사  >  웹 프론트엔드  >  jquery easyui가 형식화된 열을 구현하는 방법에 대한 자세한 설명

jquery easyui가 형식화된 열을 구현하는 방법에 대한 자세한 설명

小云云
小云云원래의
2017-12-31 15:38:241528검색

이 글은 주로 jquery easyui에서 형식화된 열을 구현하는 방법을 소개합니다. 편집자는 이것이 꽤 좋다고 생각합니다. 이제 여러분과 공유하고 참고할 것입니다. 편집자를 따라 살펴보겠습니다. 모두에게 도움이 되기를 바랍니다.

메인 프레임 페이지: 서구 메뉴에서 클릭한 URL 콘텐츠가 메인 인터페이스 영역에 로드됩니다.


<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8"/>
  <title>主界面</title>
  <p th:include="/public/util::public"/>
  <p th:include="/public/util::jquery-easyui"/>
  <script type="text/javascript" th:src="(${@configApp.getStaticWeb()})+&#39;/cms/script/main/index.js&#39;"></script>
  <script type="text/javascript" th:src="(${@configApp.getStaticWeb()})+&#39;/cms/script/site/site-index.js&#39;"></script>  
</head>
<body class="easyui-layout">
  <p data-options="region:&#39;north&#39;,title:&#39;&#39;" style="height:80px;" id="north"></p>
  <p data-options="region:&#39;west&#39;,title:&#39;系统功能区&#39;,split:true" style="width:200px;">
    <ul class="easyui-tree" id="menu"></ul>
  </p>
  <p data-options="region:&#39;center&#39;,title:&#39;主界面区&#39;" style="padding:5px;" id="center"></p>
</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==&#39;1&#39;?&#39;是&#39;:&#39;否&#39;;
  }
  </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>
  <p 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>
  </p>
</body>
</html>

해결책: 이 서식 기능을 홈페이지에 올려두면 겉으로는 문제가 없을 것입니다.

관련 권장 사항:

예제는 jQuery Easyui의 일부 사용법을 간략하게 설명합니다.

인스턴스는 각 데이터 행에 대해 EasyUI의 DataGrid 추가 작업 버튼을 설명합니다.

EasyUi 컨트롤의 Datagrid에 대한 자세한 설명

위 내용은 jquery easyui가 형식화된 열을 구현하는 방법에 대한 자세한 설명의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.