Reputation: 795
I have a smart table with action buttons in it. When I click on action button, whole smart table is covered with busy indicator, until data for action button is retrieved from back end. I tried to hide busy indicator on smart table with *
setBusy(false)
and
sap.ui.core.BusyIndicator.hide()
however it somehow does not work.
My question is, is it not possible to hide busy indicator on smart table? Is it UI5 by default property for smart table?
Upvotes: 0
Views: 1231
Reputation: 740
I had faced this issue when I had set the SmartTable
's enableAutoBinding
property to true
since I wanted to populate the table data when the app initially launches.
To resolve the issue, if you have added a Table within SmartTable
in your view, set an ID to it e.g. "idTable" and add the following line in the view's onInit
method:
this.byId("idTable").setBusy(false);
If you have not added a Table within SmartTable
in your view, fetch the SmartTable
instance and use the API getTable()
to fetch the contained table, and then use the above method in onInit
Upvotes: 0
Reputation: 4231
I don't ask why you don't want the busy indicator to be shown. Assuming you are using XML views you should be able to use attribute busyIndicatorDelay
and apply a very high value to delay the displaying of the busy indicator. For further details check the documentation.
Upvotes: 1
Reputation: 367
A simple solution would be a custom CSS rule for setting the busy indicator's display style to none
.
Let's say you did set an ID tableId
for your Smart Table, the CSS rule would be
[id$=tableId] .sapUiLocalBusyIndicator {
display: none;
}
To apply the rule on all of your Smart Tables use
.sapUiCompSmartTable .sapUiLocalBusyIndicator` {
display: none;
}
In case you only want to hide the busy indicator if you click on a specific action button you could use the method addStyleClass with a custom class in your action handler and specify the CSS rule accordingly. Of course you have to remove the class after the data is received.
Upvotes: 0