Locking filter

Answered

Comments

4 comments

  • Avatar
    Oleg

    How to do that https://documentation.sisense.com/locking-filters/  with javascript (sisenseJS)?

    0
    Comment actions Permalink
  • Avatar
    Oleg (Edited )

    Answer is very simple, add param "locked":

    dashboard.on("refreshend", function(dash, args){

        $.each(dash.filters.$$items, function(index, item){
            item.locked = true;
        });

    });

    0
    Comment actions Permalink
  • Avatar
    Oxana Noa Umansky

    Thanks for following up Oleg!

    0
    Comment actions Permalink
  • Avatar
    JJ Chritton (Edited )

    Is it possible to specify which filters are locked, or do you have to lock all of them?

    Actually, I figured out that you can specify which filter to lock by adding in an if clause if you specify which filter you want by the order they appear (where the first filter is index = 0).

    This has been particularly useful for us when filtering on dashboards that are only accessible via the jump to plugin since those filters are automatically carried through from the source dashboard.

     

    dashboard.on("refreshend", function(dash, args){

    $.each(dash.filters.$$items, function(index, item){
    if (index === 0) {
    item.locked = true;
    }
    });

    });

     

    0
    Comment actions Permalink

Please sign in to leave a comment.