


Detailed explanation of how jquery easyui implements formatted columns
This article mainly introduces how jquery easyui implements formatted columns. The editor thinks it is quite good. Now I will share it with you and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.
Main frame page: The URL content clicked on the west menu will be loaded in the main interface area.
<!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()})+'/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"> <p data-options="region:'north',title:''" style="height:80px;" id="north"></p> <p data-options="region:'west',title:'系统功能区',split:true" style="width:200px;"> <ul class="easyui-tree" id="menu"></ul> </p> <p data-options="region:'center',title:'主界面区'" style="padding:5px;" id="center"></p> </body> </html>
At this time, easy-ui has been loaded on the main page The scripts and CSS do not need to be loaded in each area page. Even if they are loaded, they will be removed.
I initially added the formatting function to the datagrid page, but it had no effect. It always reported that the formatIsvalid function could not be found. .
<!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> <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>
Solution: Put this formatting function into the main page and there will be no problem.
Related recommendations:
Example brief description of some usage of jQuery Easyui
Example detailed explanation of EasyUI's DataGrid adding operation buttons for each row of data
Detailed explanation of Datagrid in EasyUi control
The above is the detailed content of Detailed explanation of how jquery easyui implements formatted columns. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Nowadays, we will inevitably encounter some problems such as being unable to turn on the phone or lagging, such as system crash, but during use, mobile phones have become an indispensable part of our lives. We are often at a loss, and sometimes, there are no solutions to these problems. To help you solve cell phone problems, this article will introduce you to some methods of cell phone format recovery and restore your phone to normal operation. Back up data - protect important information, such as photos and contacts, from being lost during the formatting process. Before formatting your phone, the first thing to consider is to back up important data and files on your phone. To ensure data security, or choose to transfer files to a cloud storage service, you can back it up by connecting to a computer. Use the system's built-in recovery function - simple

How to remove the height attribute of an element with jQuery? In front-end development, we often encounter the need to manipulate the height attributes of elements. Sometimes, we may need to dynamically change the height of an element, and sometimes we need to remove the height attribute of an element. This article will introduce how to use jQuery to remove the height attribute of an element and provide specific code examples. Before using jQuery to operate the height attribute, we first need to understand the height attribute in CSS. The height attribute is used to set the height of an element

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

HTML formatting method: 1. Use online HTML formatting tools; 2. Use the HTML formatting shortcut keys that come with the code editor, such as Shift + Alt + F in Visual Studio Code; 3. Use plug-ins, such as Sublime Text HTML/CSS/JS Prettify plug-in; 4. Use command line tools, such as HTML Tidy; 5. Manual formatting according to coding standards and habits.

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <

Title: Use jQuery to modify the text content of all a tags. jQuery is a popular JavaScript library that is widely used to handle DOM operations. In web development, we often encounter the need to modify the text content of the link tag (a tag) on the page. This article will explain how to use jQuery to achieve this goal, and provide specific code examples. First, we need to introduce the jQuery library into the page. Add the following code in the HTML file:

How to tell if a jQuery element has a specific attribute? When using jQuery to operate DOM elements, you often encounter situations where you need to determine whether an element has a specific attribute. In this case, we can easily implement this function with the help of the methods provided by jQuery. The following will introduce two commonly used methods to determine whether a jQuery element has specific attributes, and attach specific code examples. Method 1: Use the attr() method and typeof operator // to determine whether the element has a specific attribute

Nowadays, the security of Windows 10 system computers is threatened by many viruses and programs. Let’s take a typical example. When he is surfing the Internet, he will unintentionally open a link or website, and then some very annoying advertisements will pop up on our computer inexplicably. Or if the computer is stuck in the interface and cannot move, it is likely that some software has been maliciously bundled and installed. Another situation is that there is a virus in the computer. If this kind of problem occurs, we can reinstall the system on the win10 computer, which can effectively remove the virus programs in the system disk. Now the editor will show you how to format and reinstall the win10 system. Let's read on. . 1. How to format and reinstall the win10 system? First, we click "Start" -
