Open pinguin999 opened 9 years ago
Also with around 800 rows, it would be nice to not block the whole interface while creating the treegrid.
I will think what can I do
I've got a view with a bit more than 800 rows, and with this change, it reduces from 40s to 5s. Maybe it needs more test but is seems to work fine for me. And maybe it works only with bootstrap as I'm using the "hidden" class. If not using bootstrap, it would need something to handle the visibility but you shouldn't use hide and show in a loop. Let Jquery handle the loop by applying hide and show to a collection.
it is not working for me...i have around 400 to 500 rows it is taking around 40sec..please help me out..
you've tried my change?
I have the same problem, i have ~1500 rows to show and the treegrid and treeGrid collapse parts are too long and they freeze my browser :
treeGrid: 15861.654ms
collapse: 10863.867ms
have you tried my code change suggestion ? https://github.com/YMA-MDL/jquery-treegrid/commit/633cf33392f691c3c8046f4b08324fd2bae503d2
For your change @YMA-MDL I think we should set that like this :
if ($this.treegrid('isOneOfParentsCollapsed')) {
$this.addClass('hide');
} else {
$this.removeClass('hide');
}
Because the show
class in Bootstrap show elements as block
. And the gain is very small (1s)
Strange, it made a very significant change for me. This issue was that the code was iterating on important DOM manipulation where now it's just a class update and Jquery does the rest.
but that part does not solve the tree-grid initialization. Only the collapse part. I think the modificzation to optimize the code is to rewrittent all of this without jQuery but with pure javascript and frasgments. In my code, if i try to manipulate a large amount of data, i increase the loadTime and reduce this by 10 only with fragment and javascript native DOM elements. jQuery is heavy and too resource hungry to manipulate large amount of data
@YMA-MDL - for what it's worth, integration with this script http://nexts.github.io/Clusterize.js/ would likely solve the big data pains and increase your scripts outer limits by hundreds of thousands of records. I might investigate this myself once I have some time.
Good Luck, not sure if it will allow to save nested state. Like you browse a structure, and getting back to it later, the same branches are deployd.
@YMA-MDL, did you implemented Clusterize? If yes, can you share some sample code, please?
No I did not, but I may come across the same need soon.
Thank you. I try but it does not worked :(
Also tried to combine the Clusterize, but initializing still stays slow with about 1500 rows. Commit from @YMA-MDL (thanks by the way ;-) ) was applied to the code.
Attached the performance record i did with Chrome Version 61.0.3163.100 (64-bit) for future analyses:
The Big data example takes to long to. Chrome and Firefox showing "to long working javascript" errors.
Any ideas how to speed this up? I need 1000+ rows in the android chrome.