分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
1.引入css和js
2.加入标签
注:id,用于js操作;name,用于获取值
3.加入js代码
4.JSON格式
注:后台方法(见附带demo,Data.java,easyui.jsp)
API: http://www.jeasyui.com/documentation/index.php
- <link rel="stylesheet" type="text/css" href="themes/default/easyui.css">
- <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
- <script type="text/javascript" src="js/jquery.easyui.min.js"></script>
2.加入标签
- <input id="ddtree" name="ddtree" />
注:id,用于js操作;name,用于获取值
3.加入js代码
- $('#ddtree').combotree( {
- //获取数据URL
- url : 'Data',
- //选择树节点触发事件
- onSelect : function(node) {
- //返回树对象
- var tree = $(this).tree;
- //选中的节点是否为叶子节点,如果不是叶子节点,清除选中
- var isLeaf = tree('isLeaf', node.target);
- if (!isLeaf) {
- //清除选中
- $('#ddtree').combotree('clear');
- }
- }
- });
4.JSON格式
- [ {
- "id" : 1,
- "text" : "Folder1",
- "iconCls" : "icon-ok",
- "children" : [ {
- "id" : 2,
- "text" : "File1",
- "checked" : true
- }, {
- "id" : 3,
- "text" : "Folder2",
- "state" : "open",
- "children" : [ {
- "id" : 4,
- "text" : "File3",
- "attributes" : {
- "p1" : "value1",
- "p2" : "value2"
- },
- "checked" : true,
- "iconCls" : "icon-reload"
- }, {
- "id" : 8,
- "text" : "Async Folder",
- "state" : "closed"
- } ]
- } ]
- }, {
- "text" : "Languages",
- "state" : "closed",
- "children" : [ {
- "id" : "j1",
- "text" : "Java"
- }, {
- "id" : "j2",
- "text" : "C#"
- } ]
- } ]
注:后台方法(见附带demo,Data.java,easyui.jsp)
API: http://www.jeasyui.com/documentation/index.php