Announcement

Collapse
No announcement yet.

Expand/Collapse Pivot Grid

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Expand/Collapse Pivot Grid

    Hi there. I'm working with a pivot grid in NAB and am looking for a way to fully expand or collapse a pivot grid with a button click on the widget. Is there a way to accomplish this? I see a button to fully expand when the widget is first opened in NAB but I don't see a way to accomplish this at runtime.

  • #2
    Right now you can accomplish this with Execute Script with a small amount of code.

    Expand All Columns/Rows
    Code:
    // get the customer pivot widget
    //
    var customerPivot = getWidget('customerPivot');
    
    // go down the pivot grid and request to expand all columns/rows
    //
    customerPivot.down('pivotgrid').expandAll();
    
    success();

    Collapse All Columns/Rows
    Code:
    // get the customer pivot widget
    //
    var customerPivot = getWidget('customerPivot');
    
    // go down the pivot grid and request to collapse all columns/rows
    //
    customerPivot.down('pivotgrid').collapseAll();
    
    success();
    We will add a few link to app variables for the Pivot widget so you can accomplish collapse/expanding by just setting an app variable in a future Valence 6 update.

    Thanks

    Comment


    • #3
      Next Valence 6 update will have the following link to app vars for the pivot widget;

      pivotLinkToAppVars.png

      Thanks

      Comment


      • #4
        Ah ha. That means I can use .down to get the base ExtJS object type then. Good to know. Is that in the documentation anywhere? I was trying to track something like that down but could not find it.

        I'll look forward to that update too. Thank you.

        Comment


        • #5
          As a followup to this now that this is in place, I'm running into an issue with having these controlled by app variables. The issue is that I want both the Expand and Collapse buttons to ALWAYS work when you push the button. This is because the user can hit "Expand All" for instance and expand all the rows. It does this initially by setting an expand variable to True. The user then manually collapes a few rows and do their thing and then wants to re-expand them all again. They hit the button again but the app variable is already set to True so it doesn't work anymore. I could add a separate "Collapse All" button that would set a collapse variable and clear the expand variable but that shouldn't be necessary.

          Is there a way to always clear out the expand variable once the pivot grid has performed the expand?

          Comment


          • #6
            Hi, we will have this handled in the next update. Thanks

            Comment

            Working...
            X