1. #1
    Sencha User joostvanhassel's Avatar
    Join Date
    Jan 2012
    Location
    Rotterdam, The Netherlands
    Posts
    102
    Vote Rating
    1
    joostvanhassel is on a distinguished road

      0  

    Default list scrollable=false doesn't work

    list scrollable=false doesn't work


    [edit]
    the problem seems to be a list is always scrollable, even if scrollable is set to false on the list (!), therefore the list does not get a height depending on its items.

    Is there a workaround for this behaviour?
    [/edit]


    Hi,

    In my Sencha Touch 2.0 app, I had a view with the following structure:
    Code:
    - container (scrollable = vertical)
        - container (fixed height, contains image in html)
        - list (scrollable = false, has dynamic height depending on amount of items)
    Both containers and the list had a layout = default. This allowed the user to scroll the entire view, the top image and list would scroll.

    Since I upgraded my project to Touch 2.1, this approach doesn't seem to work any more. Only the image in the container is shown, the container seems to have gotten the same height as it's parent (the top container). The list has got a height of zero (used to be; as high as needed to display all items).

    Question:
    what structure do I need to set up to be able to scroll both the image and the list at the same time?

  2. #2
    Sencha - Support Team
    Join Date
    Mar 2012
    Location
    Lawrence, KS
    Posts
    288
    Vote Rating
    37
    greg.barry has a spectacular aura about greg.barry has a spectacular aura about

      1  

    Default


    If I understand your question properly, the solution in Touch 2.1 is to add a component as an item of the list. Then attach it to the bottom or the top of the of the list by utilizing a config called scrollDock (currently undocumented).

    You should be able to do something like this:

    Code:
    Ext.create('Ext.dataview.List', {    
        store   : store,
        itemTpl : '{field1}',
        items   : [
            {
                xtype       : 'textfield',
                label       : 'TestField',
                placeHolder : 'Enter the field value',
                scrollDock  : 'top',
                docked      : 'top'
            },
            {
                xtype      : 'fieldset',
                title      : 'Test Area',
                margin     : '0 2em',
                scrollDock : 'bottom',
                docked     : 'bottom',
                items      : [
                    {
                        xtype       : 'textfield',
                        label       : 'Test',
                        placeHolder : 'Enter test value'
                    }
                ]
            }
        ]
    });
    That said, you cannot currently add children to a list in Architect. I believe that is due to be changed in the next release.

  3. #3
    Sencha User joostvanhassel's Avatar
    Join Date
    Jan 2012
    Location
    Rotterdam, The Netherlands
    Posts
    102
    Vote Rating
    1
    joostvanhassel is on a distinguished road

      0  

    Default


    I solved the problem by converting my list into a dataview. Works for now. Thanks for taking the time to respond.

  4. #4
    Sencha - Support Team
    Join Date
    Mar 2012
    Location
    Lawrence, KS
    Posts
    288
    Vote Rating
    37
    greg.barry has a spectacular aura about greg.barry has a spectacular aura about

      0  

    Default


    That's wonderful news! Thanks for the update.

Thread Participants: 1