Results 1 to 3 of 3

Thread: setItems dynamically

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Location
    shanghai,china
    Posts
    28
    Vote Rating
    0
      0  

    Default setItems dynamically

    in my application, it has a container in the following:
    Code:
    xtype: 'container',
    id:'appsContainer',
    layout:'card',
    items:null,
    i set items dynamically for the container in the controller of my application as follows:
    Code:
    var appsListview=this.getAppsListview({			id : 'appsListview',
    			store : appsStore,
    			fullscreen:true,
    			scrollable : true,
    			style:'background:transparent'
    		
    		});
    		
    		var appsCarouselview=this.getAppsCarouselview({
    			id : 'appsCarouselview',
    			fullscreen:true,
    			direction : 'horizontal',
    			directionLock : true,
    			style:'background:transparent',
    			items : items
    		});
    		
    		//this.containerItems=[appsListview,appsCarouselview];
    		this.getAppsContainer().setItems([appsCarouselview,appsListview]);
    when i run the application,the items has been added to the container,but it can not be shown immediately.after i operate other function and come back to the container, the item in the container can be shown .
    i don't know where i am wrong, anybody can help me?

  2. #2
    Sencha Premium User mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    693
    Vote Rating
    12
      0  

    Default

    cause you using a card layout you have to set the active item as well with
    http://docs.sencha.com/touch/2-0/#!/...-setActiveItem

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Location
    shanghai,china
    Posts
    28
    Vote Rating
    0
      0  

    Default

    i add a line of code as follows,but it still cannot work.

    this.getAppsContainer().setItems([appsCarouselview,appsListview]);this.getAppsContainer().setActiveItem(0);

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •