- December 3, 2020 at 7:05 am #101204
At present, I have encountered some problems when using the grid component. I hope you can help me.
At present, I use the grid component as a child component, and there is bidirectional data binding between the grid component and the parent component. The development environment is Angular. Now I can successfully display the data from the parent component in the child component-the grid through @ input. The problem is how to transfer the edited content in the grid to the parent component by @ output or in some other ways? I have read some documents, but I have no idea at present.
In other words, after editing the data in the grid component of the web page, how to obtain the data changed on the original data?
looking forward to your early reply. thank you.
LCDecember 3, 2020 at 7:27 am #101205
You can use the grid.dataSource property to get the Grid’s data source with the edits made by the end-user or through API. You can use it in order to update your parent component.
Smart UI Team
https://www.htmlelements.com/December 3, 2020 at 3:06 pm #101208
Thank you very much for your reply. We can see from the API that grid.dataSource is a DataAdapter type. So the question is how to convert this type to array? It would be great if there were relevant examples.
Thank you very much for your help.
LCDecember 3, 2020 at 5:11 pm #101209
You can access the datasource members by index and there is also a length property i.e quite easy an artay can be retrieved by just looping through the datasource with for i = 0 to datasource.length.
PeterDecember 4, 2020 at 6:46 am #101210
Thank you very much. Your reply was very helpful.
You must be logged in to reply to this topic.