Overlay List Items Using Sencha Touch

I am developing a Sencha Touch application with lists, in particular in one list we have (for example) 400 different elements, and we need to add a parameter infinite: trueto improve performance in the view.

But I am looking at strange behavior, and the elements are superimposed on the next.

enter image description here

My code is:

xtype        : 'list',
cls          : 'mweb-list',
useComponents: true,
maxItemCache: 30,
useHeaders   : false,
infinite   : true,

This behavior happens when I turn on the parameter infinite..

The cls component does not have css rules, here you can view the extended component:

Ext.define('xx.components.list.BaseListComponent', {
  extend: 'Ext.dataview.List',
  xtype : 'mwebBaseListComponent',

  config: {
    cls          : 'mweb-list',
    useComponents: true,
    emptyText    : '',
    loadingText  : '',
    useHeaders   : false
  }
});

Any hint

Thanks in advance.

0
source share
2 answers

You might want to use the variableHeights: true flag.

xtype        : 'list',
cls          : 'mweb-list',
useComponents: true,
maxItemCache: 30,
useHeaders   : false,
infinite   : true,
variableHeights: true,

, mweb , . variableHeights , css.

CSS

.mweb-list {
    --> post whatever is in here
}
0

infinite: true, itemHeight ( ) .

xtype        : 'list',
cls          : 'mweb-list',
useComponents: true,
maxItemCache: 30,
useHeaders   : false,
infinite   : true,
itemHeight : 80
0

Source: https://habr.com/ru/post/1617785/


All Articles