mardi 27 mai 2014

Sencha Sliding Navigation Menu - facebook style - Adding a Panel with two child panel

I downloaded the latest version of http://ift.tt/1mvUAYz and in the view/Main.js , for the Item1/Group 1 item, added toolbar + 2 panels, instead of toolbar + 1 panel, the code works fine:


Code:



{
title : 'Item1',
group : 'Group 1',

xtype : 'container',

// Enable the slide button using the
// defaults defined above in
// `slideButtonDefaults`.
slideButton : true,
layout: 'vbox',

items : [
{
xtype : 'toolbar',
title : 'Item 1',
docked : 'top'
},
{
xtype : 'panel',
style: 'background: red',
html: 'New1',
flex: 1,

// Mask this item when the
// container is opened
maskOnOpen : true
},
{
xtype : 'panel',
style: 'background: green',
html: 'New2',
flex: 2,

// Mask this item when the
// container is opened
maskOnOpen : true
}

]
},

The code works fine - it replaces the image you have in your demo with a panel with two vertically placed subpanels in red and green

3a4e9056-e548-11e3-8e7c-7a62e0b22e58.jpg


I am trying to refactor the code into into separate view



Code:



Ext.define('Volt.view.FeedView', {
extend: 'Ext.Panel',

requires: [
'Ext.TitleBar',
'Ext.Button',
'Ext.Toolbar',
//'Ext.Panel'
],

xtype: 'feedViewCard',


config: {

iconCls: 'action',
title: 'FeedView',

layout:
{
type: 'vbox'
},

items : [
{
xtype : 'toolbar',
title : 'FeedView',
docked : 'top'
},
{
xtype : 'container',
style: 'background: red',
html: 'New1',

flex: 1

// Mask this item when the
// container is opened
//maskOnOpen : true
},
{
xtype : 'container',
style: 'background: green',
html: 'New2',
flex: 1

// Mask this item when the
// container is opened
//maskOnOpen : true
}

]
}
});

and use the following code in view/Main.js , removing the earlier code- there are no errors, but only the green box shows up

Code:



{
xtype: 'feedViewCard',
title : 'Home Page',
group : 'Group 1',
slideButton : true

},



d811f788-e548-11e3-8378-5b1717efc73e.jpg

Also, this refactored FeedView.js shows up as two child panels when used in a TabPanel view - so it is definitely working fine. Any advice? Thanks much





Aucun commentaire:

Enregistrer un commentaire