Discussion:
[Dojo-interest] dijit.layout.BorderContainer Splitter move events (take 2)
James A. Cleland
2012-04-18 19:07:33 UTC
Permalink
I hate to beat this one to death, but it's my only remaining bug and I just
can't figure out a solution to it. I need to detect when a splitter within a
BorderContainer has been moved and/or when the contents of the region have been
resized. I've looked through the aforementioned class, the resize mixin,
_Widget, _WidgetBase but I still can't find a function that gets called when you
drag a splitter.



To make things worse, I've dropped down to <ContentPane>.domNode.onresize =
function(){} and my function is STILL not called. I tried this for the regions
on both sides of the splitter (center and trailing).



Resizing of the entire BorderContainer results in <BorderContainer>.resize()
being called and I can do my work there, but this isn't called for spitter
drags, obviously. How can I detect that the size of regions has changed via
splitter drag? Even the function to get the splitter widget appears to be
deprecated, according to the comments in the 1.7 release, not that I'd know what
event to hook on the widget or it's domNode. There's an <domNode>.onMove event
that works in IE, but it doesn't appear to be portable.



Help plz! Thanks
Ken Benjamin
2012-05-28 20:03:41 UTC
Permalink
Most likely you aren't waiting for the parser to complete and the widgets to
be ready before you're calling init().

Try wrapping init() as the callback inside dojo.ready:
http://dojotoolkit.org/reference-guide/1.7/dojo/ready.html
http://dojotoolkit.org/reference-guide/1.7/dojo/ready.html

You would have this problem regardless whether you used declarative or
programmatic instantiation.
...
NOTE: I have to delay call to init() one second after page loaded. Not
graceful... I don't know if it's related to dojo's widget loading that
takes time, but if I didn't do that, dijit.registry.byId returned
undefined and I had no access to the splitter object even if I put the
code in declarative manner.
Regards,
-----
Kenneth Benjamin

WisdomWebsite.com The wisdom you need to live well.

Check out my latest article: Do Your Politicians Suck? Why We Vote For the Wrong People and What You Can Do To Fix It
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/dijit-layout-BorderContainer-Splitter-move-events-take-2-tp3921038p3985860.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
Dan Randolph
2012-12-20 22:22:21 UTC
Permalink
function init() {
var lSplitter =
dijit.registry.byId("masterDetail").getSplitter("bottom");
dojo.connect(lSplitter.domNode, "onmouseup", someFunction);
}
Thanks Guliavan, worked great for resizing the esri map content in
bordercontainer. I used getSplitter("left") for my left-toobar window.



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/dijit-layout-BorderContainer-Splitter-move-events-take-2-tp3921038p3992446.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.

Loading...