


About the background page development tutorial of uery EasyUI combined with ztrIee
Earlier we shared with you jQuery EasyUI combined with zTree tree structure to create web pages. Below, the editor will bring you an example of backend page development using JQuery EasyUI combined with ztree. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.
JQuery EasyUI combines zTree tree structure to create web pages. easyui is relatively simple to use. It encapsulates some functions of jquery very well and is more convenient to use. However, from version 1.2.3 onwards, commercial use is required Paid,
zTree is a jquery tree plug-in developed by domestic experts. It feels easy to use, very powerful, and completely free. The API is also very good. Recommended
easyui is a jQuery-based framework that integrates various user interface plug-ins.
easyui provides the necessary functionality to build modern interactive javascript applications.
Using easyui, you don’t need to write too much javascript code. Generally, you only need to use some html tags to define the user interface.
The complete framework of HTML web page.
easyui saves time and scale in product development.
easyui is very simple, but very powerful.
The following js files and style sheets need to be imported
easyui/themes/default/easyui.css easyui/themes/icon.css jquery-1.8.3.js easyui/jquery.easyui.min.js ztree/jquery.ztree.all-3.5.js(该文件包括core,exhide,exedit,excheck) ztree/zTreeStyle.css<script type="text/javascript"> // ztree菜单设置 var zTreeObj, setting = { view: { selectedMulti: false }, // 添加编辑设置:修改树节点名称/删除树节点 edit: { enable: true }, data: { simpleData: { enable: true } }, callback:{ onClick: zTreeOnClick } }; // 回调函数:单击事件 function zTreeOnClick(event, treeId, treeNode, clickFlag) { alert(treeNode.id + ", " + treeNode.name); var content = '<p style="width:100%;height:100% ;overflow:hidden;">' +'<iframe src="' +treeNode.url +'" scrolling="auto" style="width:100%;height:100%;border:0;"></iframe></p>'; if(treeNode.url != undefined && treeNode.url != ""){ // 当centre中是否存在名称为treeNode.name的tabs if($("#tt").tabs('exists',treeNode.name)){ $("#tt").tabs('select',treeNode.name); }else { $("#tt").tabs('add',{ title:treeNode.name, content:content, closable:true }) } }; event.preventDefault(); }; // 提供ztree树形菜单数据 zTreeNodes = [ {"id":1, "pId":0, "name":"海贼王"}, {"id":11, "pId":1, "name":"娜美", "url":"http://man.linuxde.net/"}, {"id":12, "pId":1, "name":"罗宾", "url":"http://www.baidu.com"}, {"id":13, "pId":1, "name":"汉库克", "url":"http://www.google.cn/"}, { "id":2, "pId":0, "name":"父节点 2", "open":true}, {"id":21,"pId":2, "name":"叶子节点 2-1"}, {"id":22, "pId":2, "name":"叶子节点 2-2"}, {"id":23,"pId":2, "name":"叶子节点 2-3"}, {"id":3, "pId":0, "name":"父节点 3", "open":true}, {"id":31, "pId":3, "name":"叶子节点 3-1"}, {"id":32, "pId":3, "name":"叶子节点 3-2"}, {"id":33, "pId":3, "name":"叶子节点 3-3"} ]; // 3.生成树形菜单 $(document).ready(function(){ zTreeObj = $.fn.zTree.init($("#tree"), setting, zTreeNodes); }); // 4.对象选项卡注册右击事件 $(document).ready(function(){ $("#tt").tabs({ onContextMenu:function(e,title,index){ // 阻止系统默认的右击事件 e.preventDefault(); $('#mm').menu('show', { left: e.pageX, top: e.pageY }); } }); }); // 获取所选取的面板对象 $(document).ready(function(){ $("#tt").tabs({ // 获取所选取的面板对象 onSelect : function(title,index ){ // 5. menu的单击事件绑定 $("#mm").menu({ onClick:function(item){ alert(item.name); // 当点击关闭当前选项卡时 if(item.name==='current'){ $('#tt').tabs('close',title); // 当点击关闭其他选项卡时 }else if(item.name === 'others'){ var tabs = $('#tt').tabs('tabs'); $(tabs).each(function(){ if($(this).panel('options').title != '消息中心' && $(this).panel('options').title != title){ $('#tt').tabs('close',$(this).panel('options').title); } }); // 当点击关闭所有选项卡时 }else if(item.name === 'all'){ var tabs = $('#tt').tabs('tabs'); $(tabs).each(function(){ if($(this).panel('options').title != '消息中心'){ $('#tt').tabs('close',$(this).panel('options').title); } }); } } }); } }) }) </script>
The corresponding htm part code
<body class="easyui-layout"> <p data-options="region:'north',title:'北丐:洪七公',split:true" style="height:100px;"></p> <p data-options="region:'south',title:'南帝:一灯大师',split:true" style="height:100px;"></p> <p data-options="region:'east',iconCls:'icon-reload',title:'东邪:黄药师',split:true" style="width:100px;"></p> <p data-options="region:'west',title:'西毒:欧阳锋',split:true" style="width:250px;"> <p id="aa" data-options="fit:'true'" class="easyui-accordion"> <p title="赵敏" data-options="iconCls:'icon-save'" > <h3 style="color:#0099FF;">Accordion for jQuery</h3> <p>Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.</p> </p> <p title="大玉儿" data-options="iconCls:'icon-reload',selected:true" > // ztree属性结构 <ul id="tree" class="ztree" style="width:230px; overflow:auto;"></ul> </p> <p title="婉容儿" > who? </p> </p> </p> <p data-options="region:'center',title:'中神通:周伯通'"> // tabs 面板 <p id="tt" class="easyui-tabs" data-options="fit:true"> <p title="小龙女"data-options="closable:true" ></p> <p title="沐剑屏" data-options="closable:true" ></p> <p title="阿珂" data-options="iconCls:'icon-reload',closable:true"></p> </p> </p> // menu菜单栏 <p id="mm" class="easyui-menu" style="width:120px;"> <p name="current">关闭当前选项卡</p> <p name="others">关闭其他选项卡</p> <p class="menu-sep"></p> <p data-options="iconCls:'icon-cancle'" name="all">关闭所有选项卡</p> </p> </body>
Related recommendations:
Example detailed explanation jQuery EasyUI combined with zTree tree structure to create a web page
zTree asynchronous loading and expansion First-level node method implementation
The above is the detailed content of About the background page development tutorial of uery EasyUI combined with ztrIee. 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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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











Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

JavaScript's application in the real world includes front-end and back-end development. 1) Display front-end applications by building a TODO list application, involving DOM operations and event processing. 2) Build RESTfulAPI through Node.js and Express to demonstrate back-end applications.

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

Both Python and JavaScript's choices in development environments are important. 1) Python's development environment includes PyCharm, JupyterNotebook and Anaconda, which are suitable for data science and rapid prototyping. 2) The development environment of JavaScript includes Node.js, VSCode and Webpack, which are suitable for front-end and back-end development. Choosing the right tools according to project needs can improve development efficiency and project success rate.
