rakagod
25 Nov 2011, 11:39 AM
In version 4.0.7, the following code worked
this.getDispatchCards().getLayout().setActiveItem(0);
but in version 4.1 that line no longer works.
The other 2 lines that reference "setActiveItem(1) and setActiveItem(2) still work.
Also the default that set "activeItem: 0", no longer works.
},
btnRequestPressed: function() {
//alert('You clicked the ReceiveCall button!');
this.getDispatchCards().getLayout().setActiveItem(0);
this.getBtnRequest().disabled = true;
this.getBtnDispatch().disabled = false;
this.getBtnAdministration().disabled = false;
},
btnDispatchPressed: function() {
//alert('You clicked the Dispatch button!');
this.getDispatchCards().getLayout().setActiveItem(1);
this.getBtnRequest().disabled = false;
this.getBtnDispatch().disabled = true;
this.getBtnAdministration().disabled = false;
},
btnAdministrationPressed: function() {
//alert('You clicked the Administration button!');
this.getDispatchCards().getLayout().setActiveItem(2);
this.getBtnRequest().disabled = false;
this.getBtnDispatch().disabled = false;
this.getBtnAdministration().disabled = true;
}
The layout is as follows:
Ext.define('Calls.view.ui.MViewport', {
extend: 'Ext.container.Viewport',
requires: [
'Calls.view.MainToolbar',
'Calls.view.RequestForm',
'Calls.view.DispatchForm'
],
activeItem: 0,
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'panel',
itemId: 'dispatchPanels',
layout: {
type: 'fit'
}
},
{
xtype: 'mainToolbar'
},
{
xtype: 'panel',
itemId: 'dispatchCards',
activeItem: 0,
layout: {
type: 'card'
},
title: '',
items: [
{
xtype: 'panel',
itemId: 'requestFormSplit',
layout: {
align: 'stretchmax',
type: 'hbox'
},
items: [
{
xtype: 'requestForm',
flex: 1
},
{
xtype: 'panel',
itemId: 'requestFormSpacePanel',
flex: 1
}
]
},
{
xtype: 'dispatchForm'
},
{
xtype: 'panel',
itemId: 'administrationForm',
title: 'Administration',
items: [
{
xtype: 'label',
text: 'Administration form'
}
]
}
]
}
]
});
me.callParent(arguments);
}
});
this.getDispatchCards().getLayout().setActiveItem(0);
but in version 4.1 that line no longer works.
The other 2 lines that reference "setActiveItem(1) and setActiveItem(2) still work.
Also the default that set "activeItem: 0", no longer works.
},
btnRequestPressed: function() {
//alert('You clicked the ReceiveCall button!');
this.getDispatchCards().getLayout().setActiveItem(0);
this.getBtnRequest().disabled = true;
this.getBtnDispatch().disabled = false;
this.getBtnAdministration().disabled = false;
},
btnDispatchPressed: function() {
//alert('You clicked the Dispatch button!');
this.getDispatchCards().getLayout().setActiveItem(1);
this.getBtnRequest().disabled = false;
this.getBtnDispatch().disabled = true;
this.getBtnAdministration().disabled = false;
},
btnAdministrationPressed: function() {
//alert('You clicked the Administration button!');
this.getDispatchCards().getLayout().setActiveItem(2);
this.getBtnRequest().disabled = false;
this.getBtnDispatch().disabled = false;
this.getBtnAdministration().disabled = true;
}
The layout is as follows:
Ext.define('Calls.view.ui.MViewport', {
extend: 'Ext.container.Viewport',
requires: [
'Calls.view.MainToolbar',
'Calls.view.RequestForm',
'Calls.view.DispatchForm'
],
activeItem: 0,
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'panel',
itemId: 'dispatchPanels',
layout: {
type: 'fit'
}
},
{
xtype: 'mainToolbar'
},
{
xtype: 'panel',
itemId: 'dispatchCards',
activeItem: 0,
layout: {
type: 'card'
},
title: '',
items: [
{
xtype: 'panel',
itemId: 'requestFormSplit',
layout: {
align: 'stretchmax',
type: 'hbox'
},
items: [
{
xtype: 'requestForm',
flex: 1
},
{
xtype: 'panel',
itemId: 'requestFormSpacePanel',
flex: 1
}
]
},
{
xtype: 'dispatchForm'
},
{
xtype: 'panel',
itemId: 'administrationForm',
title: 'Administration',
items: [
{
xtype: 'label',
text: 'Administration form'
}
]
}
]
}
]
});
me.callParent(arguments);
}
});