1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    408
    Answers
    4
    Vote Rating
    17
    jweber will become famous soon enough

      0  

    Default Answered: Can I remove all items in a Navigation View?

    Answered: Can I remove all items in a Navigation View?


    Can I remove all items in a Navigation View? I'd like to remove the "root" card and replace it with another one.

    I've tried using reset() and pop(number of items), but they both leave the first item there.

    If I use removeAll(), it seems to work. But then when I add() another item, I get an error in Chrome 17 and Firefox 10):
    sencha-touch-all-debug.js:12583 Uncaught TypeError: Cannot read property 'style' of undefined
    Here's my sample code. It will add a card, add another, remove all cards, then try to add another.
    Code:
    Ext.setup({onReady: function() {
    	var view = Ext.create('Ext.navigation.View', {
    		fullscreen: true,
    		layout: {
    			animation: false
    		}
    	});
    	Ext.defer(function() {
    		view.push({
    			title: 'First'
    		});
    		Ext.defer(function() {
    			view.push({
    				title: 'Second'
    			});
    			Ext.defer(function() {
    				view.removeAll();
    				Ext.defer(function() {
    					view.push({
    						title: 'Third'
    					});
    				}, 1000);
    			}, 1000);
    		}, 1000);
    	}, 1000);
    }});
    (Also, in Chrome and Firefox, the navigation bar looks wrong. But that's a separate issue.)

  2. The navigation view is meant to have the same initial card. You could add and remove components from the initial card.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,668
    Answers
    3354
    Vote Rating
    746
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The navigation view is meant to have the same initial card. You could add and remove components from the initial card.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    408
    Answers
    4
    Vote Rating
    17
    jweber will become famous soon enough

      0  

    Default


    Thanks. You might want to clarify this in the documentation. For example, the reset() method says "Resets the view by removing all items between the first and last item", which is kind of confusing.

    Would it be difficult to allow the first item to be removed, leaving no inner items? It seems like this would make it more consistent with other components. Plus you can already create it with no inner items.

  5. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    31
    Answers
    1
    Vote Rating
    0
    pvmagacho is on a distinguished road

      0  

    Default


    Hi,

    I can remove all inner items from a navigation view, however the Back button is still showing.

    Can we remove all from navigation view and reset the inner counter so the back button is not shown.

    Thanks

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar