How to abort Widget Query in `beforequery` event

Comments

1 comment

  • Avatar
    Moti Granovsky (Edited )

    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 = {};
    });

    1
    Comment actions Permalink

Please sign in to leave a comment.