How to abort Widget Query in `beforequery` event
I'm implementing a function that requires to abort sisense widget in a dashboard by a check. I'm going to apply the check in `beforequery` event of the widget, however, I don't know which function in JS on widget object can help to abort sisense query from Browser to server (JAQL query).
Please give me a guide. Thanks so much.
-
Hi Tin,
Preventing a query from executing in the `beforequery` event is as simple as assigning an empty object `{}` to the `query` event argument.
This will result in the query not being sent, and the widget rendering in its "no results" mode.
Example:
widget.on('beforequery', function(ev, args) {
args.query = {};
});
Please sign in to leave a comment.
Comments
1 comment