jqGrid Tree
CSS:
<!--jqGrid-->
<link rel="stylesheet" href="plugins/jqgird/css/ui.jqgrid.min.css"/>
DOM:
实例化的DOM元素必须是table <table id="treegrid2"></table> script:
<script src="plugins/jqgird/js/jquery.jqGrid.min.js"></script>
<script src="plugins/jqgird/js/grid.locale-zh.js"></script>
//当前页面脚本
<script type="text/javascript">
$(function(){
$(document).ready(function(){
var topicjson={
"response": [
{
"id": "1",
"Items": "Grouping",
"url":"www.baidu.com",
level:"0", parent:"", isLeaf:false, expanded:false, loaded:true
},
{
"id": "1_1",
"Items": "Simple Grouping",
"url":"www.baidu.com",
level:"1", parent:"1", isLeaf:true, expanded:false, loaded:true
},
{
"id": "1_2",
"Items": "May be some other grouping",
"url":"www.baidu.com",
level:"1", parent:"1", isLeaf:true, expanded:false, loaded:true
},
{
"id": "2",
"Items": "CustomFormater",
"url":"www.baidu.com",
level:"0", parent:"", isLeaf:false, expanded:false, loaded:false
},
{
"id": "2_1",
"Items": "Image Formatter",
"url":"www.baidu.com",
level:"1", parent:"2", isLeaf:false, expanded:false, loaded:false
}
,
{
"id": "2_1_1",
"Items": "Image Formatter",
"url":"www.baidu.com",
level:"2", parent:"2_1", isLeaf:true, expanded:false, loaded:false
},
{
"id": "2_1_2",
"Items": "Anchor Formatter",
"url":"www.baidu.com",
level:"2", parent:"2_1", isLeaf:true, expanded:false, loaded:false
} ,
{
"id": "2_2",
"Items": "Anchor Formatter",
"url":"www.baidu.com",
level:"1", parent:"2", isLeaf:true, expanded:false, loaded:true
} ]
},
grid;
$('<table id="list2"></table>').appendTo('#topics');
var lastsel;
grid = jQuery("#treegrid2");
grid.jqGrid({
datastr: topicjson,//数据源
datatype: "jsonstring",//数据类型
//向后台请求数据
//url: '/Department/Query/',
//datatype: 'json',
//mtype: 'GET',
height: "auto",
width:"100%",
loadui: "enable",
colNames: ["id","Items","url"],
colModel: [
{name: "id",width:200, hidden:true, key:true},
{name: "Items", editable:true,width:250, resizable: false},
{name: "url",width:1, width:250, editable:true,hidden:false}
],
treeGrid: true,//启用girdTree
treeGridModel: "adjacency",//伸缩列模式
ExpandColumn: "Items", //伸缩列
ExpandColClick: true,
treeIcons: {plus:'ace-icon fa fa-caret-right bigger-160 blue',minus:'ace-icon fa fa-caret-down bigger-160 blue',leaf:'ace-icon fa fa-tags orange'},//树图标
caption: "jqGrid Demos",
autowidth: true,//宽度自适应
rowNum: 10000,
ExpandColClick: true,//列点击
jsonReader: {
repeatitems: false,
root: "response"
}
});
});
})
</script> <style type="text/css">
.tree-wrap.tree-wrap-ltr{
display: inline-block;
} .ui-icon.ui-icon-document-b.tree-leaf.treeclick{
position: relative;
} .ui-icon.treeclick.ui-icon-triangle-1-s.tree-minus{
position: relative;
} .ui-icon.treeclick.ui-icon-triangle-1-e.tree-plus{
position: relative;
}
</style>
jqGrid Tree的更多相关文章
- Web jquery表格组件 JQGrid 的使用 - 从入门到精通 开篇及索引
因为内容比较多,所以每篇讲解一些内容,最后会放出全部代码,可以参考.操作中总会遇到各式各样的问题,个人对部分问题的研究在最后一篇 问题研究 里.欢迎大家探讨学习. 代码都经过个人测试,但仍可能有各种未 ...
- SSM+PageHelper+jqGrid实现数据分页
前言 前几天自己写了一个分页功能,代码逻辑写的很乱今天发现jqGrid这个工具是真好用,故记录下来方便以后使用首先是PageHelper后台分页工具PageHelper的原理是基于拦截器实现的 具体流 ...
- 1. mvc 树形控件tree + 表格jqgrid 显示界面
1.界面显示效果 2.资源下载 地址 1. jstree https://www.jstree.com/ 2.表格jqgrid https://blog.mn886.net/jqGrid/ ...
- Web jquery表格组件 JQGrid 的使用 - 4.JQGrid参数、ColModel API、事件及方法
系列索引 Web jquery表格组件 JQGrid 的使用 - 从入门到精通 开篇及索引 Web jquery表格组件 JQGrid 的使用 - 4.JQGrid参数.ColModel API.事件 ...
- jqGrid配置属性说明
Property Type Description Default1) ajaxGridOptions object This option allows to set global ajax set ...
- jqGrid APi 详解
jqGrid APi 详解 jqGrid皮肤 从3.5版本开始,jqGrid完全支持jquery UI的theme.我们可以从http://jqueryui.com/themeroller/下载我们所 ...
- Jqgrid学习API
JQGrid是一个在jquery基础上做的一个表格控件,以ajax的方式和服务器端通信. JQGrid Demo 是一个在线的演示项目.在这里,可以知道jqgrid可以做什么事情. 下面是转自其他人b ...
- 【转】jqGrid 各种参数 详解
[原文]http://www.cnblogs.com/younggun/archive/2012/08/27/2657922.htmljqGrid 各种参数 详解 JQGrid JQGrid是一个 ...
- 使用ztree.js,受益一生,十分钟学会使用tree树形结构插件
看到ztree.js,这几个字眼,毋庸置疑,那肯定就是tree树形结构了,曾经的swing年代有jtree,后来jquery年代有jstree和treeview,虽然我没写过,但是我见过,一些小功能做 ...
随机推荐
- Codeforces Gym 100500F Problem F. Door Lock 二分
Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/at ...
- Codeforces Gym 100650C The Game of Efil DFS
The Game of EfilTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/v ...
- Linux设备模型分析之kset(基于3.10.1内核)
作者:刘昊昱 博客:http://blog.csdn.net/liuhaoyutz 内核版本:3.10.1 一.kset结构定义 kset结构体定义在include/linux/kobject.h ...
- string <-> wstring
// std::string -> std::wstringstd::string s("string");std::wstring ws;ws.assign(s.begin ...
- [安卓学习]AndroidManifest.xml文件内容详解
一,重要性 AndroidManifest.xml是Android应用程序中最重要的文件之一.它是Android程序的全局配置文件,是每个 android程序中必须的文件.它位于我们开发的应用程序的根 ...
- asp.net 实现“九连环”小游戏
asp.net 实现"九连环"小游戏 wildcatsky(原作) public Class ChinaRing1 Inherits System.Web.UI.Page #Re ...
- MySQL · 特性分析 · innodb 锁分裂继承与迁移
http://mysql.taobao.org/monthly/2016/06/01/ innodb行锁简介 行锁类型 LOCK_S:共享锁 LOCK_X: 排他锁 GAP类型 LOCK_GAP:只锁 ...
- TCP/IP协议知识科普
简介 本文主要介绍了工作中常用的TCP/IP对应协议栈相关基础知识,科普文. 本博客所有文章:http://www.cnblogs.com/xuanku/p/index.html TCP/IP网络协议 ...
- [原创,分享]DbHelper 续
一直在想怎么样才能让dbHelper更简单,更灵活,更僵化.终于我发布了第一个开源版本的dbhelper.此helper将使用System.Data.DbHelper作为命名空间.采用内部驱动与内容S ...
- SQL SERVER数据库状态(脱机,联机,可疑)及SQL设置语句详解
首先我们应该知道数据库总是处于一个特定的状态中,下面先来了解一下数据库的常见的三种状态:1,脱机:我们可以在Microsoft SQL Server Management中看到该数据库,但该数据库 ...