Horizontal scroll or link scroll on all widgets in dashboard

Comments

3 comments

  • Avatar
    Elliott Herz

    Hey Adam,

    Pretty neat use-case! Here is a dashboard script that works for those pivot tables that have exactly the same structure. When you scroll one of them, all of them will reflect those scrolling changes.

    dashboard.on('widgetready', (el, args) => {
    $('.p-mid', 'widget[widgetid=' + args.widget.oid + ']').scroll((scrollBar) => {
    $('.p-mid').each((_,pivot) => {
    pivot.scrollLeft = scrollBar.target.scrollLeft;
    });
    });
    });

    I had to type the code out again, as I couldn't copy and past into here. Let me know if this doesn't work, I may have typed it out and missed something small.

    Let me know if this works and helps!

    Best, Elliott

    0
    Comment actions Permalink
  • Avatar
    Adam Evans

    Thanks Elliott.  That worked beautifully!  

    1
    Comment actions Permalink
  • Avatar
    Elliott Herz

    Hey Adam, Glad it worked out for you! Was a pretty fun use-case to tackle and ended up being a decently elegant solution.

    Best, Elliott

    0
    Comment actions Permalink

Please sign in to leave a comment.