EasyUI Forum
December 01, 2025, 03:59:06 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / Bug Report / Tree bug on: June 01, 2016, 01:02:13 AM
前面同样的帖子修改后不见了, 重发一遍

http://www.jeasyui.com/forum/index.php?topic=5801.0

Tree 节点类型判断和显示逻辑有问题.

目前 tree 节点的判断是基于 state, state为open/closed 都判断为 支节点, state=null判断为叶节点. 当children不空是都没有问题但当 本节点的state是closed, children=[]时会显示 支节点, 但节点内会无限循环显示根节点的数据. 而当 本节点state=open, children=[]是 显示为叶节点.

实际应用中会有要求显示 支节点, 但下面还没有叶节点的情形. 如学校的院,系,都是支节点, 系刚开始没有招生时是空的. 不应该将还没有招生的系显示为叶节点.

正确的 支叶节点逻辑我认为应该是以children=null来判断, children=[]显示为支节点, 叶节点为空. children=null或没有显示为叶节点. 节点的state 仅是用来判定 支节点的开合状态的.

希望 EasyUI 能在下一版改正此 bug.
2  General Category / Bug Report / Re: Tree json bug on: April 06, 2016, 04:57:19 AM
This is the example on your Tree  Documentation
3  General Category / Bug Report / Tree json bug on: April 05, 2016, 05:32:05 PM
Using demo/lines.html, change data-options="url:'tree_data1.json' to following json which is the example on your Tree  Documentation, would be rendered as this:, the folder "Sub Bookds" will get into infinite loop to root node when open it
Code:
[{
    "id":1,
    "text":"Folder1",
    "iconCls":"icon-save",
    "children":[{
        "text":"File1",
        "checked":true
    },{
        "text":"Books",
        "state":"open",
        "attributes":{
            "url":"/demo/book/abc",
            "price":100
        },
        "children":[{
            "text":"PhotoShop",
            "checked":true
        },{
            "id": 8,
            "text":"Sub Bookds",
            "state":"closed"
        }]
    }]
},{
    "text":"Languages",
    "state":"closed",
    "children":[{
        "text":"Java"
    },{
        "text":"C#"
    }]
}]
4  General Category / Bug Report / accordion behaved weirdly on: April 04, 2016, 07:02:03 AM
I try to combine accordion basic and tree AJAX load examples into one, something weird happened. Attached the code below, now it works. Pay attention to those comment out sentence, when I  use "var pp = acdn.accordion('getSelected')" in place of "$('#acdn').accordion('getSelected')" it stop to work, till you comment in other 2 sentences in place of the same functional sentences. I use easyui 1.4.5.
Code:
<html>
<head>
<meta charset="UTF-8">
<title>Basic Accordion - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
<script type="text/javascript" src="json2TreeLoadFilter.js"></script>
<script>
var acdn, count = 0, sig = 0;

function onSel(ttl, idx) {
count++;
// var pp = acdn.accordion('getSelected');
var pp = $('#acdn').accordion('getSelected');
if (ttl === "TreeMenu") {
if (!sig) {
pp.html('<ul class="easyui-tree" data-options=' + '"url:' + '\'tree_data1.json\',method:\'get\',loadFilter:json2TreeLoadFilter' + '"' + '></ul>');
$.parser.parse(pp);;
sig = 1;
}
$('#info').text(pp.text());
} else if (ttl === "Help" && count > 2) {
pp.html("<h2>Hello, I'm here to mess up!</h2>");
}
};

function onClick() {
alert('hello!');
}

$(function() {
acdn = $('#acdn');
// acdn.accordion({ onSelect: onSel });
});
</script>
</head>

<body>
<h2>Basic Accordion</h2>
<p>Click on panel header to show its content. <span id="info"></span></p>
<div style="margin:20px 0 10px 0;"></div>
<div id="acdn" class="easyui-accordion" style="width:500px;height:300px;" data-options="onSelect:onSel, selected:-1">
<!-- <div id="acdn" class="easyui-accordion" style="width:500px;height:300px;">-->
<div title="About" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
<h3 style="color:#0099FF;">Accordion for jQuery</h3>
<p>Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.</p>
</div>
<div title="TreeMenu" data-options="iconCls:'icon-search'" style="padding:10px;">
</div>
<div title="Nothing" data-options="iconCls:'icon-cancel', collapsible:false" style="padding:10px;" onclick="onClick()">
</div>
<div title="Accordion" data-options="iconCls:'icon-add'" style="padding:10px;">
<h3 style="color:#0099FF;">Accordion from jQuery EasyUI</h3>
<p>Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.</p>
</div>
<div title="Help" data-options="iconCls:'icon-help'" style="padding:10px;">
<p>The accordion allows you to provide multiple panels and display one or more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.</p>
</div>
</div>
</body>
</html>
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!