Is there a way to call a widget's "Clear Selection" from a widget script?

Comments

2 comments

  • Avatar
    Nathan Giusti

    Hey Barry,

    Instead of trying to click the button progmatically, it may be easier to just replicate the effects. 

     

    I would through prism interate through your dashboard filters and set the filter jaql for all to be

    {
    "explicit": false,
    "multiSelection": true,
    "all": true
    }

    Which is basically just the include all filter. 

    Would this work?

    1
    Comment actions Permalink
  • Avatar
    Barry Gaffey

    Hi Nathan Giusti,

    I'm trying to only clear one specific filter that is controlled by a bar chart widget in this case.

    I can see that the 'Clear Selection' button ultimately calls this command and I think I'm close except that I am passing in the wrong argument(s).

    prism.$command.execute('dashboard.commands.clearWidgetSelection', 
    {$scope: prism.user},
    {dashboard: dashboard, widget: W});

     

    I've also come up with this:

    if (0 < Widget.metadata.selectionData().length) {
    Widget.metadata.clearSelection();
    }
    1
    Comment actions Permalink

Please sign in to leave a comment.