PDA

View Full Version : I need to call view from another view



bothman
14 Dec 2015, 5:22 AM
Hi
I have a main screen consist of Panel with border layout
this panel has 4 regions, and on each region there is a different panel

this is my main screen code


Ext.require(['*']);

Ext.onReady(function() {

var viewport = Ext.create('Ext.Viewport', {

layout : {
type : 'border',
padding : 5
},
defaults : {
split : true
},
items : [{
region : 'north',
collapsible : true,
title : 'North',
split : true,
height : 100,
minHeight : 60,
html : 'north'
}, {
region : 'center',

title : 'Center',
minHeight : 80,
items : [{
xtype : 'clientInformation'

}],

}, {
region : 'south',
height : 100,
split : true,
collapsible : true,
title : 'Splitter above me',
minHeight : 60,
html : 'center south',
weight : -100
}, {
region : 'south',
collapsible : true,
split : true,
height : 200,
minHeight : 120,
title : 'South',
html : 'soooooth'

}]
});
});



and I defined the first panel


Ext.define('InvoiceSys.view.items.clientInformation', {
extend : 'Ext.grid.Panel',
alias : 'widget.clientInformation',
title : 'clientInformation',
title : 'List of Items',
loadMask : true,
autoheight : true,
dockedItems : [{
xtype : 'pagingtoolbar',
dock : 'bottom',
displayInfo : true,
items : [{
xtype : 'tbseparator'
}, {
xtype : 'button',
text : 'Add Item',

}]
}],

initComponent : function() {

this.columns = [{
header : 'Item Number',
dataIndex : 'item',
flex : 1
}, {
header : 'Description 1',
dataIndex : 'desc1',
flex : 1
}, {
header : 'Description 2',
dataIndex : 'desc2',
flex : 1
}, {
header : 'Weight',
dataIndex : 'weight',
flex : 1
}];

this.callParent(arguments);
}

});




and add this panel to my main screen in the center region
but I doesn't appear,
if I add width and height fields to it I can see just the border, nothing else
I want to display the whole panel on the whole region

thanks

jdkhamba
14 Dec 2015, 4:42 PM
Looks like you have two panels both with region south.


{
region : 'south',
height : 100,
split : true,
collapsible : true,
title : 'Splitter above me',
minHeight : 60,
html : 'center south',
weight : -100
}, {
region : 'south',
collapsible : true,
split : true,
height : 200,
minHeight : 120,
title : 'South',
html : 'soooooth'


}


One of them needs to be east or west. Take a look at this example with all regions:

https://fiddle.sencha.com/#fiddle/12j5

bothman
17 Dec 2015, 12:01 AM
thank you for response

but even if I changed this region to "west" or "east" nothing change

jdkhamba
17 Dec 2015, 1:48 AM
Seems to work just fine in the example I provided. How about trying to implement your application in the same way as the example?

bothman
17 Dec 2015, 2:27 AM
ok I will do that
thanks =;