EasyUI Forum
April 29, 2024, 01:48:23 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: tree: 'closed' elements but loaded  (Read 11907 times)
mzeddd
Full Member
***
Posts: 223



View Profile
« on: October 16, 2013, 07:19:34 AM »

Hi,

When I use tree or combotree with remote data source.

Looks good but. In case if I load complete tree but have some 'closed' elements then EasyUI works not completely correct.
Even if content is loaded into my branch but branch state is set to 'closed' it tries to load content once again.
As the result I have duplicated elements or complete tree loaded again but into this branch.

Is it possible not to reload branch content if it was loaded but branch was set to 'closed'?

Thanks!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 17, 2013, 12:32:07 AM »

Please refer to this example http://www.jeasyui.com/demo/main/index.php?plugin=Tree&theme=default&dir=ltr&pitem=Async%20Tree.
Logged
mzeddd
Full Member
***
Posts: 223



View Profile
« Reply #2 on: October 17, 2013, 12:52:08 AM »

I mean I have the following tree when everything is open.

Code:
node 1 (open)
   node 1.1
   node 1.2
   node 1.3
node 2 (open)
   node 2.1
   node 2.2
   node 2.3

But I would like to load only part of this tree and keep some elements closed
Code:
node 1 (closed) <- content is loaded already. Just show it when I click on it
   node 1.1
   node 1.2
   node 1.3
node 2 (closed) <- needs to be loaded when I click on it
So for user it will look like
Code:
node 1 (closed)
node 2 (closed)
Logged
mzeddd
Full Member
***
Posts: 223



View Profile
« Reply #3 on: October 29, 2013, 11:35:57 PM »

Any ideas?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: October 30, 2013, 12:38:27 AM »

Please refer to the lazy loading example http://www.jeasyui.com/demo/main/index.php?plugin=Tree&theme=default&dir=ltr&pitem=Lazy%20Load%20Tree%20Nodes.
Logged
mzeddd
Full Member
***
Posts: 223



View Profile
« Reply #5 on: November 05, 2013, 12:09:03 AM »

Thanks for this example.

But don't you think that it would be good idea to have this functionality available by default and don't define extra functions all the time?

Also, would be good to extand this feature request with the following idea:
For example we have a tree like I showed above where "node 2" is closed and not loaded. When I click on it changes its picture from "closed folder" to "open folder".
But in case if you "open" it but don't load any data it does not look great for some cases and would be good to change the picture from "open folder" to "file".
And of course change it from "file" to "open folder" when you add any children into it.
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!