首页 > 其他分享 >【EasyUI篇】TreeGrid树表格组件

【EasyUI篇】TreeGrid树表格组件

时间:2023-01-11 21:07:56浏览次数:37  
标签:TreeGrid treeGrid1 treeGrid3 EasyUI Date new 组件 import


微信公众号:​​程序yuan​​
关注可获得更多干货哦!。问题或建议,请公众号留言;

------------------------------------------------

关注小编微信公众号获取更多资源

【EasyUI篇】TreeGrid树表格组件_List

------------------------------------------------

​​查看--> 全套EasyUI示例目录​​

 

30.TreeGrid树表格组件

 

【EasyUI篇】TreeGrid树表格组件_List_02

【EasyUI篇】TreeGrid树表格组件_List_03

 

【EasyUI篇】TreeGrid树表格组件_css_04

 

 

 

JSP文件

<%--
Created by IntelliJ IDEA.
User: ooyhao
Date: 2018/7/29 0029
Time: 9:21
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Tree</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/color.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/TreeGrid.js"></script>
<style rel="stylesheet" type="text/css">
</style>
<script>

</script>
</head>
<body style="padding: 100px;">

<%--class加载方式--%>
<%--<table class="easyui-treegrid" style="width:380px; height: 200px;"
data-options="url:'http://localhost:8081/easyui/getTreeGrid.action',
idField:'id',treeField:'name' ">
<thead>
<tr>
<th data-options="field:'name',width:180,">菜单名称</th>
<th data-options="field:'date',width:180,">创建时间</th>
</tr>
</thead>

</table>--%>
<%--Js加载方式--%>
<table id="box" style="width:380px;height:150px;"></table>
</body>
</html>

JS文件

$(function () {

$("#box").treegrid({
url:'http://localhost:8081/easyui/getTreeGrid.action' ,
idField:'id',
treeField:'name',
columns:[
[
{
title : '菜单名称',
field : 'name',
width : 180,
},
{
title : '创建时间',
field : 'date',
width : 180,
}
]
],

});

});

Contro文件

package com.ooyhao.controller;

import com.ooyhao.pojo.TreeGrid;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
* @author ooyhao
*/
@Controller
public class TreeGridController {


@RequestMapping(value = "getTreeGrid")
@ResponseBody
public List<TreeGrid> getTreeGrid(){
TreeGrid treeGrid1 = new TreeGrid();
treeGrid1.setId(1);
treeGrid1.setName("系统信息");
treeGrid1.setDate(new Date());
List<TreeGrid> lists1 = new ArrayList<>();
TreeGrid treeGrid2 = new TreeGrid();
treeGrid2.setId(1);
treeGrid2.setName("主机信息");
treeGrid2.setDate(new Date());
lists1.add(treeGrid2);
treeGrid1.setChildren(lists1);

TreeGrid treeGrid3 = new TreeGrid();
treeGrid3.setId(1);
treeGrid3.setName("会员信息");
treeGrid3.setDate(new Date());

List<TreeGrid> lists2 = new ArrayList<>();
TreeGrid treeGrid4 = new TreeGrid();
treeGrid4.setId(1);
treeGrid4.setName("认证审核");
treeGrid4.setDate(new Date());
lists2.add(treeGrid4);
treeGrid3.setChildren(lists2);

List<TreeGrid> treeGrids = new ArrayList<>();
treeGrids.add(treeGrid1);
treeGrids.add(treeGrid3);
return treeGrids;
}

}

效果图

【EasyUI篇】TreeGrid树表格组件_d3_05

------------------------------------------------

关注小编微信公众号获取更多资源

【EasyUI篇】TreeGrid树表格组件_List

------------------------------------------------

 

标签:TreeGrid,treeGrid1,treeGrid3,EasyUI,Date,new,组件,import
From: https://blog.51cto.com/u_12131813/6002835

相关文章

  • 【EasyUI篇】Spinner微调组件
    微信公众号:​​程序yuan​​关注可获得更多资源。问题或建议,请公众号留言;​​查看-->全套EasyUI示例目录​​24.Spinner微调组件    JSP文件<%--CreatedbyInt......
  • 【EasyUI篇】NumberSpinner数字微调组件
    微信公众号:​​程序yuan​​关注可获得更多资源。问题或建议,请公众号留言;​​查看-->全套EasyUI示例目录​​25.NumberSpinner数字微调组件属性列表,事件列表,方法列表全部......
  • 【EasyUI篇】Slider滑动条组件
    微信公众号:​​程序yuan​​关注可获得更多资源。问题或建议,请公众号留言;​​查看-->全套EasyUI示例目录​​26.Slider滑动条组件      JSP文件<%--Createdb......
  • 【EasyUI篇】Form表单组件
    微信公众号:​​程序yuan​​关注可获得更多资源。问题或建议,请公众号留言;​​查看-->全套EasyUI示例目录​​27.Form表单组件Controller文件@RequestMapping(value="/v......
  • 【EasyUI篇】PropertyGrid属性表格组件
    微信公众号:​​程序yuan​​关注可获得更多资源。问题或建议,请公众号留言;​​查看-->全套EasyUI示例目录​​28.PropertyGrid属性表格组件  JSP文件<%--Createdby......
  • 【EasyUI篇】Calendar日历组件
    微信公众号:​​程序yuan​​关注可了解更多的教程。问题或建议,请公众号留言;​​查看-->全套EasyUI示例目录​​22.Calendar日历组件    JSP文件<%--Createdby......
  • 【EasyUI篇】Datebox日期输入框组件
    微信公众号:​​程序yuan​​关注可了解更多的教程。问题或建议,请公众号留言;​​查看-->全套EasyUI示例目录​​23.Datebox日期输入框组件     JSP文件<%--Created......
  • 10分钟做好 Bootstrap Blazor 的表格组件导出 Excel/Word/Html/Pdf
    上篇:BootstrapBlazor实战通用导入导出服务(Table组件)1.新建工程新建工程b14tabledotnetnewblazorserver-ob14table将项目添加到解决方案中:dotnetslnadd......
  • el-date-picker组件日期显示错误,前一天
    原文链接:https://blog.csdn.net/qq_14993591/article/details/126411913使用element-uiDatePicker日期选择器,选中日期是2021-08-02至2021-08-03,浏览器中日期的值是2021......
  • windows2012通过powershell安装远程组件技巧
    概要:通过服务器管理器安装远程桌面服务会报错一直没有办法解决之后了解到安装组件可以通过power命令安装 powershell命令说明https://docs.microsoft.com/en-us/wind......