Your grid should have a store set up that loads data? You could listen on your store for data changes.
listeners: {
datachanged: function(store, eOpts) {
//localize your button
let yourButtonInToolbar, //Get Button (e.g. via ComponentQuery)
boolean = store.getData().getCount() === 0;
yourButtonInToolbar.setDisabled(boolean);
}
}
In this event the store should already have set the data if changes occured.
I did a boolean depending on the Output of the getCount
method inside the result of the getData
method on the store.
With this boolean I use the setDisabled method on the localized button in your toolbar.
I hope this helps.