1. #1
    Sencha User ThiemNguyen's Avatar
    Join Date
    Jul 2011
    Location
    Hanoi, Vietnam
    Posts
    35
    Vote Rating
    0
    ThiemNguyen is on a distinguished road

      0  

    Default Non-scrollable list inside scrolling container

    Non-scrollable list inside scrolling container


    Hi everyone,

    I have read many related posts but not found any good answers yet although I know it's not a new question.

    I would like to create a container which is scrollable and has a list and other components such as buttons or textfields which are arranged vertically. I don't want the list to be scrollable, it should just show all items.

    I've been reading many posts and found some workarounds but they are not nice enough, for example I don't want to create a vbox with fixed flex config because it creates unnecessary spaces and also doesn't work with my idea that the list should not be scrollable itself. Or also setting directionLock on the list itself is not better, either, because it won't go across and hide other components as we scroll the outer container.

    Is there any idea please?

    Thanks,
    ​Your time is limited, so don't waste it living someone else's life.

  2. #2
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    587
    Vote Rating
    32
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default


    How about setting a value to list's itemHeight and then calc the height you need like this:
    Code:
    initialize: function() {
        var itemHeight = this.getItemHeight();
        var numberOfData = Ext.getStore('myDataStore').getData().getCount();
        var list = Ext.Viewport.down('.list[itemId=myList]');
        list.setHeight(numberOfData * itemHeight;);
    }

Thread Participants: 1