I need to render a treegrid with 50k+ rows on virualScroll mode and works on both PCs and Mobiles.
There's an official snippet I get from another Issue: https://stackblitz.com/edit/angular-959stf?file=app.component.ts,app.component.html , and it doesn't have any complex feature.
On most PCs, it works fine, but on iPhone13 safari, it opens up, but after some while, the page turn white and crash with a message "a problem repeatedly occurred" which user haven't done anything, I think it's due to safari memoryLimit, so I test it on these platforms:
System: Android, ios(15+ A15), ipadOS(15+ M1)
Brand: any..., Apple
On most recent Android Devices, it open up fine (M1 ipad safari unable to open up), but my requirements need some more detailed functionality like:
custom template: each cell inside every row may render as a DropDownList or Checkbox
column dom element toggle: each cell under a column turn on/off selectRow checkbox and it display/hide
These requirements above add up to massive memory usage and performance interference, when I interact on page-success-rendered Android devices, these pages crash as well.
What's more, not just system preinstalled browser, we may also need it to run on some app built-in webview, these scenes may come with more strict memoryLimitation.
I wonder if there's any solution.
Hi NieChen,
We have checked your reported issue from your provided sample in iPhone13 safari, but TreeGrid has been rendered properly. Refer to the screenshot below:-
Sample link with Latest version:- https://stackblitz.com/edit/angular-gyr554-cd6y1h?file=app.component.html
We have checked the reported problem with latest version. So please ensure the issue with above sample link.
Also we need some more additional details to find the cause of the issue. Share us the following details.
Regards,
Farveen sulthana T
Thanks for reply!
I checked the snippet you new provide, it does open on iPhone13, noticing that I forget to mention that my data structures are in Self-Referential mode with 3 level, sorry about that!🙏🏻
The treegrid package I was using was 20.2.36, now I have updated it to 20.2.40, still facing the problem, wok on PC, but crash on IOS, after analysising the page memory timeline, the max point shall be located at the treegrid data render point
since my 50k+ data is a flat array with Self-Referential records, it looks like this, linking through "rowid"=>selfNode,
"pid"=> parentNode ( parent's rowid )
the component shall auto generate the flat array to hierarchy structure and there's a loop function called convertToFlatData, maybe this step or at this point beforeAfter is costing too much memory? And I found the treegrid refresh method call this step as well ( I didn't call refresh at page render point, I mean this may explain why some Android Device opens fine but after actions still crash ), my treegrid datasouce is passing by direct assign from an Ajax request response
Again, thanks for helping with my problem!
Here's a json file of all my row datas, Please checkout.
And my columns are generated from a loop.
Hi NieChen,
We have prepared sample as like (Self-reference structure with 50K+ records) but we are unable to replicate the problem at our end(TreeGrid renders properly). Refer to the sample link:-
https://stackblitz.com/edit/angular-gyr554-5tuax7?file=app.component.html
Screenshot:- (From IPhone)
IPad Safari:-
We need some more additional details to find the cause of the issue. Share us the following details.
Regards,
Farveen sulthana T
Glad to tell, my problem solved!
My treegrid has the feature to add new Columns and the row field mapping is from the column headerText,
so 50k+ rows Object , for column "999", each row has the object structure like obj{ '999':'someText', ...... } ,
refer to V8 engine Object key method, numeric keys consuming much more memory, https://jayconrod.com/posts/52/a-tour-of-v8-object-representation
So I should Just avoid setting row object filed to numeric keys, especially when demonstrating a big amount of datas,
Maybe consider adding this tip to the treegrid doc? 😁
Hi NieChen,
Thanks for your update. We will validate this case and will add this scenario in our TreeGrid documentation as per your suggestion. Please get back to us if you need any further assistance. We are happy to assist you further.
Regards,
Farveen sulthana T