1. #1
    Touch Premium Member
    Join Date
    Jan 2011
    Posts
    13
    Vote Rating
    0
    worldblender is on a distinguished road

      0  

    Default Answered: list can't be scrolled or selected

    Answered: list can't be scrolled or selected


    I have a simple app with a list that used to scroll and behave great. But now after switching to ST2, the list doesn't scroll and its items are not selectable. Below is the relevant code. Any ideas?

    Code:
    new Ext.application({
      name: 'testapp',
      launch: function() {
        mainPanel = new Ext.Panel({
          fullscreen: true,
          layout: 'card',
          cardSwitchAnimation: 'slide',
          items: [frontPanel, backPanel]
        });
      }
    });
    
    
    var frontPanel = new Ext.form.FormPanel({
      layout: 'fit',
      items: [{
        xtype: 'list',
        scrollable: 'vertical',
        store: attrs,
        itemTpl: '{attribute}'
      }]
    });
    I'm on ST2 Beta 1, and I've tested this on Android 2.3.6, Chrome, and iPod Touch v2

  2. Are you creating your formpanel outside the launch method? If so, you shouldn't.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Are you creating your formpanel outside the launch method? If so, you shouldn't.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Touch Premium Member
    Join Date
    Jan 2011
    Posts
    13
    Vote Rating
    0
    worldblender is on a distinguished road

      0  

    Default


    actually moving it into the launch function solved my problem. I never had to do this before in ST1, and it's kind of dirty -- now I'll have hundreds of lines of code in that one function.

    you can mark this answered

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by worldblender View Post
    actually moving it into the launch function solved my problem. I never had to do this before in ST1, and it's kind of dirty -- now I'll have hundreds of lines of code in that one function.

    you can mark this answered
    You should really use Ext.define to create all your classes and use xtypes (or xclass) in the items array in the config object. You would then have a single Viewport that would create it's items.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Touch Premium Member
    Join Date
    Jan 2011
    Posts
    13
    Vote Rating
    0
    worldblender is on a distinguished road

      0  

    Default


    One thing I noticed is that when scrolling, my finger actually shifts the whole panel up or down. Basically, the bottom of the list is pushed up while I scroll up, and the top of the list is pushed down while I scroll down. It's pretty jarring. Have you seen this?

  7. #6
    Touch Premium Member
    Join Date
    Jan 2011
    Posts
    13
    Vote Rating
    0
    worldblender is on a distinguished road

      0  

    Default


    I found the solution to my previous problem too: I set the parent of the list (the FormPanel) to scrollable: false

    Hope this helps someone :-)

Thread Participants: 1

Tags for this Thread