JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Custom Command Column in React › Reply To: Custom Command Column in React
January 30, 2021 at 9:21 am
#101408
admin
Keymaster
Hi Brian,
Inside the custom command function ‘this’ is in the context of the function. It should be Ok if you define it like that:
const that = this; window.commandColumnCustomCommand = function (row) { that.setState({showWarehouseId: row.data.id}, () => { console.log(that.state.showWarehouseId) })};
Regarding the ‘class’ and ‘className’, you are right. Using class instead of className produces warnings and in strict mode errors. We will update the samples.
Hope this helps.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/