PDA

View Full Version : Custom button in header of vertically collapsed panel



Spenna
5 Nov 2013, 5:46 AM
I came across the sencha fiddle app (https://fiddle.sencha.com/), which has a kind of neat way of showing a button in the 'header' of the western panel when it is collapsed. (screenshot: http://screencast.com/t/CK62vfb6ztvf )
I'm wondering how to achieve this.
I played around with the 'placeholder' config of the panel, but got nowhere so thought i'd ask for directions here.

burnnat
5 Nov 2013, 6:56 AM
I'm not sure how the Sencha Fiddle app accomplishes this (maybe if Mitchell runs across this thread he'd be willing to share some info on that), but if you want to add your button to the default placeholder, one approach would be to hook into the collapse event of the panel and inject your button into the placeholder at that point. I've put together a short fiddle to demonstrate this here (https://fiddle.sencha.com/#fiddle/1cn).

Of course, if you don't want any of the default stuff you could also supply a custom placeholder directly, as you indicated. I'm not sure why you'd run into any problems doing that - if you put together a fiddle that shows the problem, someone here could help you figure it out.

Spenna
6 Nov 2013, 1:23 AM
Thanks mate, the beforecollapse approach works great!