zoukankan      html  css  js  c++  java
  • 利用easyUI填充表格数据

    easyui tree
    后台获取json数据,根据前台需要的json数据格式建立bean
    如:
    { "id":1,
    "text":"Folder1",
    "iconCls":"icon-save",
    "children":[{
    "text":"File1",
    "checked":true }
    {
    "text":"Books",
    "state":"open",
    "attributes":{
    "url":"/demo/book/abc",
    "price":100
    },
    1. bean实体类属性 id text iconcls children(list) attributes (根据里面属性判断为map)
    2. nodecontroller
    @RequestMapping(value="myNodes", produces=MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    treeNode tn=new treeNode(); tn.setid= "";tn.settext="";...
    list<treeNode> nodes=new arrayList<treeNode>();
    nodes.add(tn);//即获取到的json数据
    3.前台通过easyUI获取json数据通过树的名字,${'#mytree'}
    代码如下
    <script type="text/javascript">
    $(function(){
    //当页面加载完毕之后,初始化树
    $('#myTree').tree({
    url:'<%=basePath%>getMenu.do',
    onClick:function(node){
    alert(node.attributes.url);
    if ($('#myTree').tree('isLeaf',node.target)) {
    $("#myTabs").tabs('add',{
    title:node.text,
    href:"<%=basePath%>" + node.text,
    closable:true,
    iconCls:'icon-ok'

  • 相关阅读:
    HDU2159 二维完全背包
    HDU1401 BFS
    HDU2842 矩阵乘法
    CF2.E
    CF2.D
    *HDU2254 矩阵乘法
    CF2.C
    *HDU1907 博弈
    博弈
    *HDU2147 博弈
  • 原文地址:https://www.cnblogs.com/lgf428/p/6086856.html
Copyright © 2011-2022 走看看