EasyUI01.搭建简易管理员页面

本文介绍了如何利用EasyUI框架构建Web界面,包括创建静态目录结构,如index.jsp中的布局控制和数据加载。通过实例演示了如何配置north, south, west和center区域,并使用JQuery EasyUI实现菜单树。
摘要由CSDN通过智能技术生成

目录

EasyUI

使用EasyUI创建静态目录结构


EasyUI

又叫Jquery EasyUI,是基于Jquery的界面框架插件,提供了丰富的界面功能,方便快速开发Web界面

EasyUI目录结构

使用EasyUI创建静态目录结构

index.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<!-- min:压缩版,导入js,css $代表jquery -->
  <script src="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/jquery.easyui.min.js"></script>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/themes/icon.css">
</head>
<body class="easyui-layout">
<!--regin位置-->
<div data-options="region:'north',title:'网站信息',collapsible:false" style="height:100px;"></div>
<div data-options="region:'south',title:'赞助链接',collapsible:false" style="height:100px;"></div>
<div data-options="region:'west',title:'菜单',split:true" style="width:20%;">
    <ul id="sidebarTree"></ul>
</div>
<div data-options="region:'center',title:'主体部分'" style="padding:5px;background:#eee;"></div>
<script>
    $("#sidebarTree").tree({
        url: "${pageContext.request.contextPath}/sidebarTree.js",
        lines: true
    })
</script>
</body>
</html>

 sidebarTree.js

[
  {
    "id": 1,
    "text": "商品管理",
    "attributes": {
      "pid": 0
    },
    "children": [
      {
        "id": 2,
        "text": "商品管理01",
        "attributes": {
          "pid": 1
        }
      },
      {
        "id": 3,
        "text": "商品管理02",
        "attributes": {
          "pid": 1
        }
      }
    ]
  },
  {
    "id": 10,
    "text": "类别管理",
    "attributes": {
      "pid": 0
    },
    "children": [
      {
        "id": 11,
        "text": "类别管理01",
        "attributes": {
          "pid": 10
        }
      },
      {
        "id": 12,
        "text": "类别管理02",
        "attributes": {
          "pid": 10
        }
      }
    ]
  }
]

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
EasyUI是一个基于jQuery的开源UI框架,可以方便地创建前端页面。 1. 下载EasyUI 首先需要下载EasyUI,可以从官网下载最新版本的EasyUI。 2. 引入EasyUIEasyUI的CSS和JS文件引入到HTML文件中。 3. 创建页面结构 根据需要创建HTML页面结构,例如: ``` <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>EasyUI页面</title> <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css"> <script type="text/javascript" src="easyui/jquery.min.js"></script> <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script> </head> <body> <div class="easyui-layout" style="width:100%;height:100%;"> <div data-options="region:'north',split:true" style="height:100px;">North Region</div> <div data-options="region:'west',split:true" style="width:200px;">West Region</div> <div data-options="region:'center'">Center Region</div> </div> </body> </html> ``` 这个例子使用了EasyUI的布局组件来创建一个页面布局。 4. 使用EasyUI组件 根据需要使用EasyUI提供的组件,例如: ``` <input class="easyui-textbox" data-options="prompt:'请输入用户名'"> ``` 这个例子使用了EasyUI的文本框组件。 5. 自定义样式 可以根据需要自定义EasyUI的样式,例如: ``` <style type="text/css"> .easyui-textbox { width: 200px; } </style> ``` 这个例子将EasyUI的文本框组件宽度设置为200px。 以上就是使用EasyUI搭建前台页面的基本步骤。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值