I want to disabled an Export Button when the data not available in the grid.
Asked
Active
Viewed 52 times
1

jitendra kumar
- 128
- 6
-
Just for clarification: You want to disable the export button when the grid has no data loaded? – DerKorb Jan 17 '20 at 12:38
1 Answers
1
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.

DerKorb
- 672
- 4
- 10