EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 14, 2024, 11:01:49 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Huge JSON tree
Pages: [
1
]
« previous
next »
Print
Author
Topic: Huge JSON tree (Read 7101 times)
PaulMcGuinness
Newbie
Posts: 15
Huge JSON tree
«
on:
October 06, 2014, 07:46:14 AM »
Hi,
I'm loading a very large JSON tree which is properly formatted into the tree control using the following line:-
$('#' + divId).tree('loadData',amTreeSource);
The fetching is ok, as is the sorting of the child nodes within the JSON data, but this can freeze the browser and throw up a 'script not responding' message.
How can I take this large JSON object and asynchronously pass it to .tree() ?
Cheers,
Paul
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Huge JSON tree
«
Reply #1 on:
October 07, 2014, 09:29:18 AM »
Please try to use the async tree.
http://www.jeasyui.com/tutorial/tree/tree2.php
Logged
PaulMcGuinness
Newbie
Posts: 15
Re: Huge JSON tree
«
Reply #2 on:
October 07, 2014, 11:50:40 AM »
Unfortunately I can't use that method as the data is being returned from a 3rd party platform.
I have the entire tree as a JSON object - could you perhaps suggest a method for walking the JSPN object and asynchronously inserting the nodes via setTimeout() ?
There is approx. 10 nodes off the root, and ideally I'd like to async add each of these (and their children) - this would solve the issue for me.
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Huge JSON tree
«
Reply #3 on:
October 07, 2014, 06:45:21 PM »
This example shows how to get full hierarchical tree data but lazy load nodes level by level.
http://www.jeasyui.com/demo/main/index.php?plugin=Tree&theme=default&dir=ltr&pitem=Lazy%20Load%20Tree%20Nodes
Logged
PaulMcGuinness
Newbie
Posts: 15
Re: Huge JSON tree
«
Reply #4 on:
October 08, 2014, 02:03:01 AM »
This is exactly what I was looking for - Many thanks!
For anyone else having the same issue, I simply implemented it using this method:-
$('#myTree').tree({loadFilter: myLoadFilter,....rest of parms....})
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...