I have 50000 lines of data, I use AddRecord in the last line to add data that is not displayed。
I added AddRecord to the official example https://stackblitz.com/edit/angular-jy8yuy-8s65so?file=app.component.ts , When you click the button, sometimes the added row will not be displayed
Hi liu,
Query#:- When you click the button, sometimes the added row will not be displayed
We have checked your reported problem from using your provided samples but we are unable to replicate the problem at our end. Refer to the screenshot:-
We need some more additional details to find the cause of the issue. Share us the following details:-
Regards,
Farveen sulthana T
Adding any form of task to the last line will have a probability of disappearing. Sometimes it's OK and sometimes it's not. After I click refresh to try again, or sometimes the last line of records will appear blank。
Adding records in any form on other pages can be directly displayed, but sometimes blank space appears when adding records in the last line of the last page。
I put a video in the compressed package. Please check it
Hi liu,
We are able to replicate the problem from your provided details. We will check for the feasible solution to achieve your requirement and provide you further details by on or before 3rd June 2022. Until then we appreciate your patience.
Regards,
Farveen sulthana T
Hi liu,
We regret for the inconvenience caused.
We need some more time to find a feasible solution of your reported problem and we will update you further details by on or before 7th June 2022. Until then we value your patience.
Regards,
Farveen sulthana T
Hi liu,
We appreciate your patience.
We are able to replicate the problem from your provided details. On further validation, we have confirmed this issue as a bug and logged defect report for the same “Added data not properly shown when we add records using addRecord method at the bottom”. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technical feasibility and Product Development Life Cycle) and including the defect fix in our weekly patch release after Volume 2 main release. Until then we appreciate your patience.
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this Feedback link.
After implementing this, you can add the records using TreeGrid addRecord method instead of using workaround with adding data using splice method.
Regards,
Farveen sulthana T
Hi liu,
We appreciate your patience.
As we stated in previous update, we have added the new
records with addRecord method of the TreeGrid. By default, when we
perform add action, TreeGrid get refresh and scroller will move to original state(i.e.
to the first record). But while binding Hierarchical data, the behavior
doesn’t work. In order to achieve this behavior, we suggest to use selectRow
method (i.e selectRow(0)) to navigate into corresponding required position.
In your scenario, you want to add the record at bottom of the TreeGrid, so to move the scroller for required position after adding the records we have select the row by passing the last set of records by calculating it from pageSettings.pageSize with selectRow method and add the record using addRecord method of the TreeGrid with newRowPosition Bottom.
Refer to the code below:-
|
addRecord1() { let dataSource: any = this.treegrid.dataSource; var childRow = { TaskID: Math.floor(Math.random() * (100000 + 1 - 50000) + 50000), FIELD1: 'new', Crew: [ // here Crew is childMapping property { TaskID: Math.floor(Math.random() * (100000 + 1 - 50000) + 50000), FIELD1: 'new', }, { TaskID: Math.floor(Math.random() * (100000 + 1 - 50000) + 50000), FIELD1: 'new', }, ], }; this.treegrid.addRecord(childRow,this.treegrid.grid.dataSource.length - 1,'Bottom'); this.treegrid.selectRow(this.treegrid.grid.dataSource.length - this.treegrid.grid.pageSettings.pageSize); } |
Note:- Likewise you can persist the scroller at the required position while adding new records with addRecord method with different newRowPosition by calling the selectRow method using actionBegin event with args.requestType as Save
Sample link:- https://stackblitz.com/edit/angular-n8eark?file=app.component.html,app.component.ts
API link:- https://ej2.syncfusion.com/angular/documentation/api/treegrid/#addrecord
https://ej2.syncfusion.com/angular/documentation/api/treegrid/editSettings/#newrowposition
Please get back to us if you need any further assistance.
Regards,
Farveen sulthana T