Select to view content in your preferred language

Close Title Pane with Javascript

2906
4
Jump to solution
03-28-2014 06:27 AM
jaykapalczynski
Honored Contributor
Trying to close my Title Pane with this.  Not working....Thoughts?
Appreciated...

var panetoggler  = 0;   on(dom.byId("button1"), "click", function () {       alert("closing");    var floatingpane = dojo.widget.byId(Tools);    if (panetoggler == 0){     floatingpane.show();     panetoggler = 1;   }   else{     floatingpane.hide();     panetoggler = 0;   }      })


<div data-dojo-type="dijit/TitlePane" id="Tools"  data-dojo-props="title:'Tools', closable:false,  open:false">  <div data-dojo-type="dijit/layout/ContentPane" style="width:200; ">         <div class="toolbar"><input type="button" class="myButton" id="button1" value="Identify" /></div>  </div> </div>
0 Kudos
1 Solution

Accepted Solutions
BenFousek
Deactivated User
//it's open if (tp.open) {   tp.toggle(); } //it's not open if (!tp.open) {   tp.toggle(); }

View solution in original post

0 Kudos
4 Replies
jaykapalczynski
Honored Contributor
GOT IT WITH THIS

dijit.byId("Testpane").set('open',false); //Close

dijit.byId("Testpan").set('open',true); //Open
0 Kudos
BenFousek
Deactivated User
Call toggle() on the title pane.

titlePane.toggle();
0 Kudos
jaykapalczynski
Honored Contributor
how could I test if its open or not
0 Kudos
BenFousek
Deactivated User
//it's open if (tp.open) {   tp.toggle(); } //it's not open if (!tp.open) {   tp.toggle(); }
0 Kudos