PDA

View Full Version : [CLOSED] [ST2.0.1] Ext.navigation.View never pops 1st item - bug or undocumented feature?



vvs
11 May 2012, 12:12 PM
REQUIRED INFORMATION

Ext version tested:

ST 2.0.1

Description:

Ext.navigation.View never pops 1st item.
Ext.navigation.View reset() does not remove all items as documented: "Resets the view by removing all items between the first and last item."

Is it bug or undocumented feature?

Steps to reproduce the problem:

Create navigation view
push 1 item
pop 1 item / or reset view

The result that was expected:

navigation view contains no inner items

The result that occurs instead:

navigation view still contains pushed item

Test Case:


Ext.application({
requires: ['Ext.navigation.View'],

launch: function () {
this.test1(Ext.create('Ext.navigation.View', {}));
this.test2(Ext.create('Ext.navigation.View', {}));
this.test3(Ext.create('Ext.navigation.View', {}));
this.test4(Ext.create('Ext.navigation.View', {}));
},

test1: function (nw) {
console.log('TEST1');

nw.push({ xtype: 'component', html: 'Component 1', title: 'title 1' });
console.log('after 1st push: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
nw.push({ xtype: 'component', html: 'Component 2', title: 'title 2' });
console.log('after 2nd push: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());

nw.pop();
console.log('after 1st pop: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
nw.pop();
console.log('after 2nd pop: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
},
test2: function (nw) {
console.log('TEST2');

nw.push({ xtype: 'component', html: 'Component 1', title: 'title 1' });
console.log('after 1st push: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());

nw.pop();
console.log('after 1st pop: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
},
test3: function (nw) {
console.log('TEST3');

nw.push({ xtype: 'component', html: 'Component 1', title: 'title 1' });
console.log('after 1st push: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
nw.push({ xtype: 'component', html: 'Component 2', title: 'title 2' });
console.log('after 2nd push: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());

nw.pop(2);
console.log('after pop(2): ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
},
test4: function (nw) {
console.log('TEST4');

nw.push({ xtype: 'component', html: 'Component 1', title: 'title 1' });
console.log('after 1st push: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
nw.push({ xtype: 'component', html: 'Component 2', title: 'title 2' });
console.log('after 2nd push: ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());

nw.reset();
console.log('after reset(2): ' + nw.getInnerItems().length + '/' + nw.getNavigationBar().getTitleText());
}

});

mitchellsimoens
11 May 2012, 1:48 PM
This is not a bug. This is by design. The navigation view must have an initial view.