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,虽然我没写过,但是我见过,一些小功能做 ...
随机推荐
- VS里面如何设置环境默认的开发语言
- [Jest] Test JavaScript with Jest
Let's learn how to unit test your JavaScript with Jest, a JavaScript unit testing framework from Fac ...
- Centos 6.5使用Bumblebee关闭N卡,冷却你的电脑
夏天来了,笔记本装的Centos一直非常热.随着天气的变化,这个问题真的要攻克了.差了下原因可能是双显卡笔记本,N卡驱动不完好,导致风扇狂叫. 昨天安装了nvidia 的显卡驱动本以为时间安静了.但是 ...
- Blueprint编译过程
Blueprint 编译概述 一.术语 Blueprint,像C++语言一下的,在游戏中使用前须要编译.当你在BP编辑器中,点击编译button时候.BP资源開始把属性和图例过程转换为一个类对象处理. ...
- mysql 5.6 原生Online DDL解析
http://seanlook.com/2016/05/24/mysql-online-ddl-concept/ 做MySQL的都知道,数据库操作里面,DDL操作(比如CREATE,DROP,ALTE ...
- 实例源码--Android理财工具源码
下载源码 技术要点: 1.Sqlite数据库的综合使用 2.控件的综合使用 3. 源码带详细的中文注释 ...... 详细介绍: 1. Sqlite数据库的综合使用 本套源码采用了Sqlite ...
- RPC框架Thrift例子-PHP调用C++后端程序
更新 2016-02-22: Response对象不用主动创建. 前言 前段时间用了一下Facebook的开源RPC框架Thrift,做PHP客户端调用C++后端程序,真心觉得Thrift不错! 本文 ...
- Eclipse常用快捷键集合
一.通用快捷键 [ALT+/] 此快捷键为用户编辑的神级好帮手,能为用户提供内容的辅助,不要为记不全方法和属性名称犯愁下 [Ctrl+T] 搜索当前接口的实现类 [Ctrl+O] 显示类中方法和 ...
- 炼数成金hadoop视频干货04
视频地址:http://pan.baidu.com/s/1dDEgKwD 这一节讲的全是理论 任务执行优化 : 1.推测式执行: 2.重用JVM: 3.忽略模式. 除了手动修改Log4J.proper ...
- cocos2d-x lua table与json的转换
cocos2d-x lua table与json的转换 version: cocos2d-x 3.6 1.引入json库 require("src/cocos/cocos2d/json&qu ...