You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When users add a new record to the DataGrid or TreeList, an empty row for it appears at the top. This behavior is inconvenient in scenarios when users want to add many records to the bottom of the table one by one - you have to go to the top to enter a new record and then scroll to the bottom to see it.
The Proposed Solution
We plan to add the index of the row to the change object of the changes array. To add a new record to the end of the DataGrid or TreeList, set the index to -1.
UPDATE: This functionality was released as a CTP in v21.1. However, after re-examining the use cases, we decided to use row keys instead of indices for the RTM release. To insert a new row at a custom position, you will need to specify the insertBeforeKey or insertAfterKey property. Both these properties accept the key of a row before/after which you want to insert the new row. As an alternative, we will add a newRowPosition property to allow you to choose a predefined position:
newRowPosition: "first"/"last" - Insert a new row at the beginning/end of the dataset.
newRowPosition: "pageTop"/"pageBottom" - Insert a new row at the top/bottom of the current page.
newRowPosition: "viewportTop"/"viewportBottom" - Insert a new row at the top/bottom of the viewport
We encountered several complex issues when implementing the editing.newRowPosition option for TreeList. So, this option will not be available for TreeList in v21.2. We will schedule this feature for release for TreeList in one of our future major versions.
These features are now available in DataGrid in the v21.2 release. I'm closing this thread. In the case of bugs or questions, feel free to create a new ticket in our Support Center.
DataGrid and TreeList - New record position
Problem
When users add a new record to the DataGrid or TreeList, an empty row for it appears at the top. This behavior is inconvenient in scenarios when users want to add many records to the bottom of the table one by one - you have to go to the top to enter a new record and then scroll to the bottom to see it.
The Proposed Solution
We plan to add the
index
of the row to the change object of the changes array. To add a new record to the end of the DataGrid or TreeList, set theindex
to -1.UPDATE: This functionality was released as a CTP in v21.1. However, after re-examining the use cases, we decided to use row keys instead of indices for the RTM release. To insert a new row at a custom position, you will need to specify the
insertBeforeKey
orinsertAfterKey
property. Both these properties accept the key of a row before/after which you want to insert the new row. As an alternative, we will add anewRowPosition
property to allow you to choose a predefined position:newRowPosition
: "first"/"last" - Insert a new row at the beginning/end of the dataset.newRowPosition
: "pageTop"/"pageBottom" - Insert a new row at the top/bottom of the current page.newRowPosition
: "viewportTop"/"viewportBottom" - Insert a new row at the top/bottom of the viewportThis revised API is due for release in v21.2.
Create a new record at a custom position
Angular
React
Vue
jQuery
We Need Your Feedback
Take a Quick Poll
Do you find the ability to set a new record position useful for your project?
Don't forget to subscribe to this thread for updates on this topic.
The text was updated successfully, but these errors were encountered: