Knowledge Base Article

How To Abort Widget Query In `Beforequery` Event

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 = {};
});
Updated 03-02-2023
No CommentsBe the first to comment