Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    17
    Vote Rating
    0
    jmendez88 is on a distinguished road

      0  

    Default Carousel - Problems to add items dinamically into a existing carousel

    Carousel - Problems to add items dinamically into a existing carousel


    Hello,

    I have a carousel in a view, and i want to add items into the carousel. In my controller I get de carousel, and I use the add method to add items, but the new information is not showed.

    After that, y press F5 and it works.

    My view:

    Code:
    Ext.define('App.view.name',{
    extend: 'Ext.Panel',
    alias: 'widget.carouselView',
    config: {
                  ....,
                  items: [
                               {
                                     xtype: 'carousel',
                                     cls: 'carrusel-imagenes-ofertas',
                                     indicator: true,
                                      items: [
                                      ]
                               }
                 ]
       }
    });
    My controller:

    Code:
    refs: {
               ......,
               myCarousel: 'carouselView carousel', 
    
    },
    methodName: function() {
       var myCarousel = this.getMyCarousel();
       myCarousel.removeAll(true);
       var panelTmp = Ext.create('Ext.Panel', {
          html: '<img alt="" src= "<img_path>"/>'
       });
                
       myCarousel.add(panelTmp);
       myCarousel.setActiveItem(0);
    
    }
    Thanks,

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    11
    Vote Rating
    2
    the_Chameleon is on a distinguished road

      0  

    Default


    hello,

    it's because your ref is not good.

    define id in your view :

    Code:
    xtype: 'carousel',
    id : 'carouselPanel'
    cls: 'carrusel-imagenes-ofertas',
    indicator: true
    Then, change your ref

    Code:
    refs: {
               ......,
               myCarousel: '#carouselPanel',  // add '#' because it's an id
    
    
    },
    methodName: function() {
    var myCarousel = this.getMyCarousel();
    }
    see controller guide : http://docs.sencha.com/touch/2-1/#!/guide/controllers

    good luck

  3. #3
    bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    This example of dynamically adding items to a carousel works.

    name.js (view)
    Code:
    Ext.define('App.view.name', {
       extend: 'Ext.Panel',
       xtype: 'carouselView',
    
    
       requires: [
          'Ext.carousel.Carousel'
       ],
    
    
       config: {
          layout: 'fit',
          items: [
             {
                xtype: 'carousel'
             },
             {
                xtype: 'button',
                text: 'add',
                action: 'add',
                docked: 'bottom'
             }
          ]
       }
    });
    Main.js (controller):
    Code:
    Ext.define('App.controller.Main', {
       extend: 'Ext.app.Controller',
    
    
       config: {
          refs: {
             myCarousel: 'carouselView carousel'
          },
          control: {
             'button[action=add]': {
                tap: 'handleAddButtonTap'
             }
          }
       },
    
    
       handleAddButtonTap: function(btn) {
          var c = this.getMyCarousel();
    
    
          c.add({
             xtype: 'panel',
             html: new Date(),
             layout: 'fit'
          });
       }
    });
    Try this out and see if it works for you. If not, please describe more about your situation. When does the method that dynamically adds items to the carousel run?

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    17
    Vote Rating
    0
    jmendez88 is on a distinguished road

      0  

    Default


    Hello Brice,

    I tried it, but it didn't work, so I attach my example (without sencha sdk).

    ¿Could you help me?

    Thank you ver much.
    Attached Files

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    17
    Vote Rating
    0
    jmendez88 is on a distinguished road

      0  

    Default


    I changed the type of the Main view. I have used a NavigationView and I have solved the problem.

Thread Participants: 2

Tags for this Thread