AnsweredAssumed Answered

Programmatically created TitlePane, closing doesn't resize?

Question asked by schlot on Mar 31, 2014
Latest reply on Mar 31, 2014 by schlot
I have a project that allows the user to select a county either from a map or from a drop down list.  Once the county is selected, query tasks are executed and title panes are created to hold a dGrid of data.  Once the dGrids are displayed, I wanted to minimize the original TitlePane containing the map.

I find myself dealing with the opening and closing of title panes a lot more than I would have thought.  I was able to close the original map's titlePane using
registry.byId('tp_map').set ('open', false);


But that wasn't enough.  I had to also add lines to change the size of that first titlePane.  I assumed I had to do this since I started out with a single TitlePane, so it was occupying the majority of my screen. 

  function collapseMap(){    registry.byId('tp_map').domNode.style.height = "30px";       }

Then I realized I had a similar problem with the titlePanes I'd created programmatically.  In the past,  I've used these before declaratively and when I do, closing the pane takes you to just the title, and the contents are hidden.  These titlepanes I'm creating are not.  Even after the contents are 'closed', the space allocated to them still exists as an empty frame.  I'm not quite sure why.

http://jsfiddle.net/schlot/56PHB/

Outcomes