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
    Dec 2011
    Location
    ahmedabad
    Posts
    34
    Answers
    2
    Vote Rating
    0
    vijay.chauhan is on a distinguished road

      0  

    Question Unanswered: carousel activeitemchange event issue

    Unanswered: carousel activeitemchange event issue


    requirement :
    when user select first question from carousel and if it's selected it redirected to another question.user not allowed to swap card until select of question's one of the answer.

    below code works fine for me in Sencha Touch PR2 but not Works in Sencha Touch Final.
    is there any way to complete my requirement?

    Code:
    {
        xtype : 'carousel',
        id : 'carouselCndtQues', 
       indicator : true,
        flex : 1,
        direction : 'horizontal',
        items : prepareCarouselChildArray(),
        listeners : {
            scope : this,
            activeitemchange : function(cmp,newCard,oldCard,eopts){
                if(condition  to check question is true or false)
                {
                    return false;//if question is not selected
                }
            }
        }
    }

    question 1.png question 2.png

  2. #2
    Sencha - Sencha Touch Dev Team Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Answers
    24
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    To prevent the action of an event from being invoked, you need to add your listener to the front of the queue. Do so by adding an 'order' option with value of 'before', i.e:

    Code:
    {
        scope: this,
        order: 'before',
        activeitemchange: ...
    }
    Sencha Touch Lead Architect

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Location
    ahmedabad
    Posts
    34
    Answers
    2
    Vote Rating
    0
    vijay.chauhan is on a distinguished road

      0  

    Default


    3.png
    but my panel in side carousel is invisible.

  4. #4
    Sencha - Sencha Touch Dev Team Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Answers
    24
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    It's possible that the logic in your listener callback doesn't take into account when the Carousel is initialized and the first active item is set (which was not supposed to be prevented).

    Change your 'listeners' block to this:

    Code:
    listeners: {
        initialize: function() {
            this.onBefore('activeitemchange', function() {
                // Your code goes here
            });
        }
    }
    or

    Code:
    listeners: {
        order: 'before',
        activeitemchange: function(){
            if (!this.initialized) {
                return;
            }
            
            // Your code goes here
        }
    }
    Sencha Touch Lead Architect

  5. #5
    Sencha User
    Join Date
    Dec 2011
    Location
    ahmedabad
    Posts
    34
    Answers
    2
    Vote Rating
    0
    vijay.chauhan is on a distinguished road

      0  

    Question carousel activeitemchange event issue

    carousel activeitemchange event issue


    this code works but screen shot shows issue.
    related to old card & new card.when old card is 1st in view it shows 2nd but when resize the browser in view it shows 1st but indicator is not updated.
    try to run demo code it reproduce the issue.
    is it error with activeitemchangeevent?
    Code:
    bootstrap = function () {
        startPanel = Ext.create('Ext.Panel', {
            id: 'pnlStart',
            layout: 'card',
            fullscreen: true,
            scrollable: false,
            activeItem: 0,
            items: [{
                xtype: 'carousel',
                id: 'carouselCndtQues',
                indicator: true,
                flex: 1,
                direction: 'horizontal',
                items: [{
                    id: 'page1',
                    html: 'page1'
                }, {
                    id: 'page2',
                    html: 'page2'
                }, {
                    id: 'page3',
                    html: 'page3'
                }],
                listeners: {
                    scope: this,
                    order: 'before',
                    activeitemchange: function (cmp, newCard, oldCard, eopts) {
                        if (!this.initialized) {
                            return;
                        }
                        alert('Old Card : ' + oldCard.getHtml() + '\nNew Card : ' + newCard.getHtml());
                        return false;
                    }
                }
            }]
        });
        Ext.Viewport.add(startPanel);
    }
    Ext.setup({
        onReady: bootstrap
    });
    1.png 2.png 4.png

Thread Participants: 1