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
You don't. At least not in a documented way. See also.
In our fork, we added row as an, yet undocumented, property to all DataSourceChange events.
In this original library you need to lookup the data via mytable.grid.getRows().find(r => MyDataClass.equals(r.getData(), event.data)).
Unrelated Off-Topic explanation of the above code
Always be aware of the typical pitfalls in Typescript. You should use an equals method and you should have this method static in your class. Neither == nor === are guaranteed to find the correct element. Another option would be to have an ID attribute and compare r.getData().id === event.data.id but if you ever want to change that in future, you are better off with an equals method.
Now, why should that be static? Because when you start getting your data from a server (like a REST API e.g.) and you are just extracting that JSON, you don't have any methods on that object. Even if you assign a JSON response from a server to a variable of your data class, that class won't have any methods. It even won't have any attributes if some of them are optional in the REST response.
Can't find anything on docs or here on the repo about getting the row element. Every event gets the row data but how to get the element?
The text was updated successfully, but these errors were encountered: