EasyUI Forum
April 28, 2024, 05:40:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: When you have Tree and combotree on page, combotree is not functionaling well  (Read 9455 times)
rkpunjal
Newbie
*
Posts: 15


View Profile
« 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?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: December 28, 2015, 03:11:49 PM »

Please provide an example to demonstrate your issue.
Logged
rkpunjal
Newbie
*
Posts: 15


View Profile
« Reply #2 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>
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 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)
);
Logged
rkpunjal
Newbie
*
Posts: 15


View Profile
« Reply #4 on: December 29, 2015, 01:39:48 AM »

loading data using the other 'loadData' method works fine  Smiley Thankyou so much !!!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!