PDA

View Full Version : Remove dock from kitchen sink.



blessan
1 Oct 2010, 2:13 AM
My app follows the kitchen sink code structure.
My inner cards have top docks of their own, so I want to remove the top toolbar that appears for every card in the kitchen sink. I was able to hide the toolbar. But when I try to make the card resize and cover the empty space,
it doesnt comeout right. My panel fills up the top space but then there is unfilled space in the bottom.

Can someone help me with this. I tried doLayout and doComponentLayout and all the inner cards but they didnt work.

This is how I got this much done. This is the modified portion of index.js in the kitchen sink demo.

http://img840.imageshack.us/img840/8336/problemh.png



onNavPanelItemTap: function(subList, subIdx, el, e) {
var store = subList.getStore(),
record = store.getAt(subIdx),
recordNode = record.node,
nestedList = this.navigationPanel,
title = nestedList.renderTitleText(recordNode),
card, preventHide, anim;

if (record) {
card = record.get('card');
anim = record.get('animation');
preventHide = record.get('preventHide');
}

if (Ext.orientation == 'portrait' && !Ext.is.Phone && !recordNode.childNodes.length && !preventHide) {
this.navigationPanel.hide();
}

if(!Ext.is.Phone) {
if(this.navigationBar.isVisible()) {
this.navigationBar.hide();
this.navigationBar.doComponentLayout();
}
}

if (card) {
this.setCard(card, anim || 'slide');
this.currentCard = card;
if(card.alias == 'admin') {
bookSettings.onBackTap();
card.setCard(bookSettings,{type: 'slide', direction: 'right'});
} else if(card.alias == 'sell') {
card.setCard(openNestedList,'slide');
}
if(card.alias == 'book') {
card.setCard(expressClientPanel,{type: 'slide', direction: 'right'});
}
}

if (title) {
this.navigationBar.setTitle(title);
}
this.toggleUiBackButton();
this.fireEvent('navigate', this, record);
},

mitchellsimoens
1 Oct 2010, 6:41 AM
You need to do the doComponentLayout on the parent of the dock not the dock itself.

blessan
3 Oct 2010, 8:24 PM
I tried doing on a lot of things like this.currentCard,this.navigationPanel etc. But there always a space in the first card switch and then everything go alright in the card switch after that. Could some one help me with this. I havent been able to fix this since 0.93 version.

blessan
4 Oct 2010, 10:28 PM
Does someone know how to fix this. Still can find a way to get it done. The code wrote earlier solved this in version 0.93 but since then I just cant get it done.

blessan
5 Oct 2010, 2:35 AM
Just got it fixed. I just hide the dock while it was created and everything is fine.