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

      0  

    Default Unanswered: scrollable picker does not retain position.

    Unanswered: scrollable picker does not retain position.


    Hi, I'm trying to implement a picker that is scrollable horizontally. I'm trying to scroll left/right to view the other slots and have it retain the position so I can swipe the slots. I tried implementing it here http://www.senchafiddle.com/#15B4e using the scrollable configuration but haven't have much luck. It snaps back to its original position when I stop swiping.

  2. #2
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    617
    Vote Rating
    28
    Answers
    67
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default


    I don't think there is any support for a tru horizontal picker. From what I see in sources:
    Picker has

    Code:
    layout: {            type : 'hbox',            align: 'stretch'        },


    Slot has:
    Code:
    applyTitle: function(title) {        //check if the title isnt defined        if (title) {            //create a new title element            title = Ext.create('Ext.Component', {                cls: Ext.baseCSSPrefix + 'picker-slot-title',                docked      : 'top',                html        : title            });        }        return title;    },
    
    scrollToItem: function(item, animated) {        var y = item.getY(),            parentEl = item.parent(),            parentY = parentEl.getY(),            scrollView = this.getScrollable(),            scroller = scrollView.getScroller(),            difference;        difference = y - parentY;        scroller.scrollTo(0, difference, animated);    },
    I don't see any support for horizontal scroll in picker, you better start write one from scratch.

Thread Participants: 1

Tags for this Thread