Results 1 to 3 of 3

Thread: Picker scroller does not refresh when overdone

  1. #1
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    599
    Answers
    35

    Default Picker scroller does not refresh when overdone

    Hi there,

    I have embedded a 'picker' inside a 'container' and I am changing pickerslot content on the fly.

    When I add 4 data to the slot
    - and I select the last
    - and then scroll as further to the top
    - then I exchange the 4 data for 1 data

    --> I can scroll the one item all the way up to the position of the first item of 4 data.

    example (while the selection should be at the position of '4'):
    Code:
                       1        1
                       2
                       3
    #selection row#####4###########
    Code:
    Ext.define('App.view.Selection', {
       extend: 'Ext.Container',
       xtype: 'selection',
    
       config: {
          scrollable: null,
          layout: 'vbox',
          items: [{
             xtype: 'picker',
             height: '100%',
             doneButton: false,
             cancelButton: false,
             useTitles: true,
             toolbar: {
                ui: 'light',
                title: 'Choose a number'
                        },
             slots: [{
                name: 'mytext',
                title: 'Text',
                data: []         // loaded on the fly
             }, {
                name: 'mynumber',
                title: 'Number',
                data: []         // loaded on the fly
             }]
          }, {
             xtype: 'button',
             text: 'Choose',
             docked: 'bottom'
           }]
       }
    
    So far I tried :
    Code:
    // slot is the picker slot
    // slotStore is the store of the slot
    // scroller is the getScrollable().getScroller() of the slot
    
    
    //here I set the data and scrollToTop()
    scroller.scrollToTop();
    slotStore.removeAll();
    slotStore.setData(slotArray);
    
    Ext.defer(function () {
       scroller.refresh();
       scroller.refreshMaxPosition();
    },200);
    // another try
    scroller.setDisabled(true);
    scroller.setDisabled(false);
    Any idea how to solve this?

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    Can you provide a fiddle (https://fiddle.sencha.com) demonstrating the issue so I can work with you on resolving this? I'm not sure I completely follow your requirements.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    599
    Answers
    35

    Default

    Hi @tristan.lee
    Here is a fiddle



    1. load Data with the bottom button
    2. power click on the left slot items (fast click 3-5 times on different numbers)
    3. select the first item on the left, wait until the right side updated and scroll the right side all the way up

    --> The item should stick to the top and not to the middle.

    On mobile devices you do not need to click that fast to make it happen as on a PC.Can you help?

Similar Threads

  1. Replies: 5
    Last Post: 8 Sep 2015, 4:35 AM
  2. Replies: 3
    Last Post: 28 Nov 2013, 2:30 AM
  3. Scroller refresh method? Documentation?
    By JCelentano in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 31 Oct 2013, 6:51 AM
  4. Replies: 2
    Last Post: 22 Mar 2013, 5:22 AM
  5. Invalidate Scroller on refresh
    By RandyIntegra in forum Sencha Ext JS Q&A
    Replies: 2
    Last Post: 9 Feb 2012, 2:00 PM

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
  •