zoukankan      html  css  js  c++  java
  • jqgrid下treeGrid的插件配置

    function gridList() {
    var $gridList = $("#gridList");
    $gridList.jqGrid({
    treeGrid: true, 
    datatype: "json",
    auto true,
    //rownumbers: true,
    shrinkToFit: false,
    gridview: true,    
    treeGridModel: "adjacency",
    ExpandColumn: "org_name",
    url: "/index.php/organise/organise_list",
    height: $(window).height() - 96,
    colModel: [
    { label: "主键", name: "org_Id", hidden: true, key: true },
    { label: '名称', name: 'org_name',  200, align: 'left' },
    { label: '编号', name: 'org_num',  150, align: 'left' },
    { label: '分类', name: 'org_category',  150, align: 'left' },
    { label: '备注', name: 'description',  150, align: 'left' },
    
    { label: '操作', name: 'org_Id',  150, align: 'center',
    formatter: function (org_Id,options, rowObject) {
    var showStatus=rowObject.is_delete==0?"启用":"禁用";
    return '<a href="/index.php?/organise/organise_edit/'+org_Id+'">编辑</a> | <a href="/index.php?/organise/organise_del/'+org_Id+'">'+showStatus+'</a></td>';
    
    }
    }    
    ]
    });
    }
    {
        "rows": [
            {
                "level": 1,
                "isLeaf": false,
                "expanded": true,
                "org_Id": "2",
                "parent": "1",
                "org_name": "北京伟景行股份有限公司",
                "org_num": "",
                "org_category": "公司",
                "description": ""
            },
            {
                "level": 2,
                "isLeaf": true,
                "expanded": false,
                "org_Id": "3",
                "parent": "2",
                "org_name": "行政部",
                "org_num": "",
                "org_category": "部门",
                "description": ""
            },
            {
                "level": 2,
                "isLeaf": true,
                "expanded": false,
                "org_Id": "4",
                "parent": "2",
                "org_name": "财务部",
                "org_num": "",
                "org_category": "部门",
                "description": ""
            },
            {
                "level": 2,
                "isLeaf": true,
                "expanded": false,
                "org_Id": "5",
                "parent": "2",
                "org_name": "信息部",
                "org_num": "",
                "org_category": "部门",
                "description": ""
            },
            {
                "level": 1,
                "isLeaf": false,
                "expanded": true,
                "org_Id": "6",
                "parent": "1",
                "org_name": "伟景行科技有限公司",
                "org_num": "",
                "org_category": "公司",
                "description": ""
            },
            {
                "level": 2,
                "isLeaf": true,
                "expanded": false,
                "org_Id": "7",
                "parent": "6",
                "org_name": "新业务部",
                "org_num": "",
                "org_category": "部门",
                "description": ""
            },
            {
                "level": 2,
                "isLeaf": false,
                "expanded": true,
                "org_Id": "8",
                "parent": "6",
                "org_name": "数据中心",
                "org_num": "",
                "org_category": "部门",
                "description": ""
            },
            {
                "level": 3,
                "isLeaf": true,
                "expanded": false,
                "org_Id": "9",
                "parent": "8",
                "org_name": "项目一部",
                "org_num": "",
                "org_category": "部门",
                "description": ""
            },
            {
                "level": 3,
                "isLeaf": false,
                "expanded": true,
                "org_Id": "10",
                "parent": "8",
                "org_name": "项目二部",
                "org_num": "",
                "org_category": "部门",
                "description": ""
            },
            {
                "level": 4,
                "isLeaf": true,
                "expanded": false,
                "org_Id": "11",
                "parent": "10",
                "org_name": "智慧城市",
                "org_num": "",
                "org_category": "小组",
                "description": ""
            },
            {
                "level": 4,
                "isLeaf": true,
                "expanded": false,
                "org_Id": "12",
                "parent": "10",
                "org_name": "智慧旅游",
                "org_num": "",
                "org_category": "小组",
                "description": ""
            }
        ]
    }
    "level": 2, "isLeaf": false, "expanded": true,"parent": "10",  很重要,应该是缺一不可
  • 相关阅读:
    iOS开发之Xcode8兼容适配iOS 10资料整理笔记
    C#流概述
    C#回调实现的一般过程
    ASP.Net MVC的学习
    RAID基本知识
    Infiniband基本知识
    [转]开源实时视频码流分析软件:VideoEye
    [转]高分一号的落后与特色
    [转]MVC,MVP 和 MVVM 的图示
    图文助你打开MS SQL Serever的ldf和mdf文件
  • 原文地址:https://www.cnblogs.com/beipiaoxiaohuo/p/6228844.html
Copyright © 2011-2022 走看看