#5945 closed enhancement (fixed)
BorderContainer has hard coded class names
Reported by: | dante | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | Dijit | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
refs #5941 - BorderContainer has fixed class dijit.layout._Splitter hard coded.
propose
splitterClass="dijit.layout._Splitter"
and
var c = dojo.getObject(this.splitterClass); new c({});
in _setupChild of BorderContainer
This allows the user to override the splitter to have things like a close button, or support closing on double-click, etc. Maybe more esoteric things like a setCenter() method that moves a splitter to the 50% point of the BorderContainer?.
Attachments (1)
Change History (9)
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Owner: | set to Adam Peller |
Changed 13 years ago by
Attachment: | borderContainer.patch added |
---|
comment:2 Changed 13 years ago by
Milestone: | 1.2 → 1.1 |
---|
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 12 years ago by
I do not understand how to set _splitterClass because it is private. I was hoping to be able to declare it like this:
<div id="main" persist="false" dojoType="dijit.layout.BorderContainer?" splitterClass="dijit.layout.MySplitter?">
However this does not work without changing _splitterClass to splitterClass and this._splitterClass to this.splitterClass.
comment:5 Changed 12 years ago by
Description: | modified (diff) |
---|
Hmm yeah the checkin comment is inaccurate. Since the parser ignores private attributes the only way I see is to create your BorderContainer programatically, or to make a subclass. Still, creating a subclass is simple, you could even do it with dijit.Declaration.
comment:6 Changed 12 years ago by
yes I meant programatically. It was decided to make it private to not commit to the API (also using strings I'm not proud of, should accept direct class references and convert from string is found on the attribute by parser or something)
you could also delegate?
my.Thinger = dojo.delegate(dijit.layout.BorderContainer?, { _splitterClass:... }) new my.Thinger();
comment:7 Changed 12 years ago by
I'm sorry if I'm being thick, but can I do it with dijit.Declaration declaratively?
I tried
var myThinger = {_splitterClass: "rajit.layout.SashSplitter"}; <div dojoType="dijit.Declaration" widgetClass="rajit.layout.BorderContainer" mixins="dijit.layout.BorderContainer" attributeMap="myThinger" ></div> <div id="pageContainer" dojoType="rajiit.layout.BorderContainer"....
I also tried using the "replaceVars" property instead of the "attributeMap" property.
comment:8 Changed 12 years ago by
I was thinking something like:
<div dojoType="dijit.Declaration" widgetClass="rajit.layout.BorderContainer" mixins="dijit.layout.BorderContainer" defaults="{ _splitterClass: 'rajit.layout.SashSplitter' }" ></div>
Hmm, I guess this makes sense.