EasyUI Forum

General Category => Bug Report => Topic started by: rkpunjal on December 28, 2015, 08:42:44 AM



Title: When you have Tree and combotree on page, combotree is not functionaling well
Post by: rkpunjal on December 28, 2015, 08:42:44 AM
When you have Tree and combotree on page, combotree is malfunctionling.
Selecting a node on combotree is working.
Does anyone know how i can get this working?


Title: Re: When you have Tree and combotree on page, combotree is not functionaling well
Post by: jarry on December 28, 2015, 03:11:49 PM
Please provide an example to demonstrate your issue.


Title: Re: When you have Tree and combotree on page, combotree is not functionaling well
Post by: rkpunjal on December 28, 2015, 10:41:26 PM
Created a simple html demo page.
Attaching the file gave a 'disk full' error, so pasting the code here.

Code:
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Tree - Combotree on same page Issue 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="themes/color.css">

    <script type="text/javascript" src="jquery.min.js"></script>

    <script type="text/javascript" src="jquery.easyui.min.js"></script>
</head>
<body>

<h2>Tree + Combotree on same page Issue Demo </h2>
Having a Tree and a Combotree on the same page seems to cause malfunction of the combotree.
<br/>Try selecting something in the combotree. That fails ...
<br/>If you comment out the loadData for Tree, then the combotree works fine.
<br/> <br/>

<table width="50%">
  <tr>
    <td width="25%">
Tree
<hr/>
<ul id="my_tree" class="easyui-tree"></ul>
</td>

    <td valign="top">
Combotree
<hr/>
<input
id="my_combo_tree"
class="easyui-combotree"
/>
</td>
  </tr>
</table>

<script>
var hierarchichalData = [ {
    "id" : 50,
    "text" : "categ-1",
    "children" : [ {
      "id" : 52,
      "text" : "categ-1-1",
      "children" : null
    }, {
      "id" : 54,
      "text" : "categ-1-2",
      "children" : null
    } ]
  }, {
    "id" : 51,
    "text" : "categ-2",
    "children" : [ {
      "id" : 53,
      "text" : "categ-2-1",
      "children" : null
    } ]
  } ];
 

$(function(){

// load the combo-tree
$("#" + "my_combo_tree").combotree(
        'loadData', hierarchichalData
    );

// load the tree
// (combo-tree works fine if you comment out below loadData for the tree)
$("#" + "my_tree").tree(
        'loadData', hierarchichalData
    );

});

</script>

</body>


Title: Re: When you have Tree and combotree on page, combotree is not functionaling well
Post by: jarry on December 29, 2015, 01:30:23 AM
Please load a different data into the tree and combotree components.
Code:
// load the combo-tree
$("#" + "my_combo_tree").combotree(
    'loadData', hierarchichalData
);

// load the tree
$("#" + "my_tree").tree(
    'loadData', $.extend(true,[],hierarchichalData)
);


Title: Re: When you have Tree and combotree on page, combotree is not functionaling well
Post by: rkpunjal on December 29, 2015, 01:39:48 AM
loading data using the other 'loadData' method works fine  :) Thankyou so much !!!