Opened 10 years ago

Closed 10 years ago

#10419 closed defect (invalid)

TitlePane needs open element to be a string

Reported by: mflash Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.4.0b
Keywords: dijit TitlePane open false string Cc:
Blocked By: Blocking:

Description

When using the Zend Framework to create a dijit.TitlePane? it only works with the false as a string:

{"id":"explanation_note","params":{"open":"false","dojoType":"dijit.TitlePane"}}

ZF initializes the TitlePane? through this:

dojo.addOnLoad(function() {
 dojo.forEach(zendDijits, function(info) {
   var n = dojo.byId(info.id);
   if (null != n) {
     dojo.attr(n, dojo.mixin({ id: info.id }, info.params));
   }
  });
  dojo.parser.parse();
}); 

The div

<div title="AO-classification" id="explanation_note"><p style='text-align: center;'><img src='/pics/ao_ptf_classification.png' /></p></div> 

If open is set to anything like 0 or "" it opens the TitlePane? as if the value had been true. I don't think this is a ZF issue but a Dojo issue since 0 or "" usually is treated as false.

Change History (1)

comment:1 Changed 10 years ago by bill

Resolution: invalid
Status: newclosed

only works with the false as a string:

The open parameter is a boolean and should be specified as such, not as a string.


If open is set to anything like 0 or "" it opens the TitlePane as if the value had been true.

That's incorrect, any of the following commands (try them in firebug console) will create a closed TitlePane:

new dijit.TitlePane({title: "my title", content: "hello world", open: false}).placeAt(dojo.body(), 0);
new dijit.TitlePane({title: "my title", content: "hello world", open: 0}).placeAt(dojo.body(), 0);
new dijit.TitlePane({title: "my title", content: "hello world", open: ""}).placeAt(dojo.body(), 0);
Note: See TracTickets for help on using tickets.