in that snippet i add 1000 records then i search country header filter. After searching header filter “aa1” i put code to change no to show number list automatically.
but if the records 8000 then it will stuck.
am i doing wrong? or 8k records is too much for the grid to that opration?
grid.data.forEach(function (item, index, array) {
grid.data.update(item.id, { no: i++},true); //third parameter is "true"
grid.paint() //repaint the grid
});
In this case the grid won’t repaint automatically after each update() operation and you should call paint() manually after all the changes finish.
Here is the updated example: https://snippet.dhtmlx.com/sm62plzr
The best workaround to implement row numbering in your case is to use the template: () => {} property for the numbered column (see template documentation).
Using the row.$index service property
Example: DHTMLX Snippet Tool
Please note that $index is a service property and may change in future versions without notice.
However, it’s important to note that there is currently no official built-in support for row numbering. As a result, in this workaround, row numbers will always start from 1, even when sorting in descending order — the first visible row will still be numbered as 1.
I’ve passed your suggestion to our development team, and it may be considered for one of the upcoming updates. Thank you for your feedback!
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan