Posted 11 February 2024, 8:39 pm EST
Hi Chandra,
You can handle the ‘formatItem’ event of the FlexGrid to insert a custom icon for expand/collapse in each group row, and handle the click event on this icon to get node data from the server and insert it into the grid, but this will only increase complexity of code in your application, and you may need to handle all possible scenarios yourself, so we suggest to use the current approach i.e. to use a dummy node, you can insert dummy nodes in the data on client side, i.e. after receiving the actual data from the server, you’ll not need to keep dummy data on server, and it will also reduce the complexity of code, by keeping it simple and easily understandable. So, this would be the best approach for your requirements.
Regarding triggering of ‘groupCollapsedChanged’ event, this event is triggered for each item when the collectionView is refreshed, that’s why you can see this event triggering a lot of times, however, it would not cause any performance impact in your application, until any heavy task is performed using this event. Also, there is an extra check implemented in the code, that ensures that the required code is executed for necessary groups only. You can also handle the click event on the grid to get data from the server and insert it into the grid, but in that case also, ‘groupCollapsedChanged’ event will be triggered multiple times, which is expected, as the collection view needs to be refreshed after inserting nodes data from the server to the grid data. So, overall you can the ‘groupCollapsedChanged’ event, which seems to be the best approach for now, in case you face any issues, you can let us know.
Regards