PDA

View Full Version : Extend TabPanel to introduce new properties



jbrooksuk
3 Feb 2011, 5:01 AM
Hi all,

In my application, I took a page out of the book from the Kitchen Sink example and used a "sink.Structure" like way to structure the layout.


sink.Structure = [{
title: ' ',
cls: 'homescreen card',
iconCls: 'home',
layout: 'fit',
items: bbt.Home,
source: 'ext/util/home.js'
}, {
title: ' ',
cls: 'bookingsscreen card',
iconCls: 'tags',
layout: 'fit',
items: bbt.Bookings,
source: 'ext/util/bookings.js'
}, {
title: ' ',
cls: 'messagescreen card',
iconCls: 'messages',
items: bbt.Messages,
source: 'ext/util/messages.js'
}, {
title: ' ',
cls: 'feedscreen card',
iconCls: 'news',
items: bbt.Feeds,
source: 'ext/util/feeds.js'
}, {
title: ' ',
cls: 'settingsscreen card',
iconCls: 'settings',
items: bbt.Settings,
source: 'ext/util/settings.js',
layout: 'card'
}];
I'm also using a more custom version of the UniversalUI that's also found from the Kitchen Sink to use a universal header toolbar and TabPanel layout.

I then set useToolbar to false on any nested lists that are found in the panels, and use the toggleUIButton function to display the back button, I also introduce listeners on the NestedList to determine whether the back button should be displayed, based on whether the cardswitch(index) is more than 0 (seems to be working so far).

So my question(s)...

Is there a way I can extend my structure code to allow for a custom property; hasNestedList?
Is there a better way to determine whether to show the back button when inside a nestedList?

Cheers,
James