PDA

View Full Version : new web 2.0 layout and hardcoded function



kuzynpiy
20 Oct 2006, 1:11 PM
Hello,
Your new layout extension is great. But some things are hardcoded and sometimes it's not possible to influence on application behaviour. For example: I do no know what's the id of splitters when creating the body layout:

var layout = new YAHOO.ext.BorderLayout(document.body, {
west: {
split:true,
So now how to add sth like this:

splitter.el.on('dblclick', myFunction)

Peter

jack.slocum
20 Oct 2006, 2:09 PM
layout.getRegion('west').split.el.on(...)

danvega
20 Oct 2006, 6:51 PM
Can you post your working code? I would like to see a working example of a dblClick event handlers for a splitter to collapse it.

Thanks

kuzynpiy
21 Oct 2006, 4:06 AM
You can test it on http://interpc.pl/~pwywiol/test/splitter.htm
The site works with yui-ext_32_3.js. And dblClick is implemented as below:

function initUI(){
var YSB = YAHOO.ext.SplitBar;
var split1 = new YSB('split1', 'topPane', YSB.VERTICAL, YSB.TOP);
split1.minSize = 100;
split1.maxSize = 400;
split1.onMoved.subscribe(adjustTop);
split1.el.on('dblclick', function(){split1.setCurrentSize(split1.minSize);
split1.onMoved.fireDirect(split1, split1.minSize);});

var split2 = new YSB('split2', 'leftPane', YSB.HORIZONTAL, YSB.LEFT);
split2.minSize = 170;
split2.maxSize = 300;
split2.onMoved.subscribe(adjustLeft);
split2.el.on('dblclick', function(){split2.setCurrentSize(split2.minSize);
split2.onMoved.fireDirect(split2, split2.minSize);}); (...)
What You have done Jack is fascinating. I work as system designer and I?m going to prepare some flexible framework - this is why I am interested with Your web 2.0 layout. The only problem now for me is I do not know javascript, so maybe I ask You simple question.

Peter