sencha touch overlay 里使用 list
1 sencha touch 中 list 如果不设置一个固定高度或 flex : 1, list 的内容就不会显示出来。
主要是因为 list 是可滚动的,你不设置高度 ,list 的高度默认就是 0px。
其实数据都是在的,只是没有显示出来。遇到 list 不显示的情况, 一般先看 dom 中是否有数据, 再看 store 中是否有
数据,如果 dom 中有数据就是布局的问题了。
2 今天在 overlay 中套了一个 list, 发现设 flex : 1 是没用的,必须设置一个固定高度才能显示。
Ext.define('MyTest.view.Overlay', {
extend : "Ext.Panel",
xtype : 'myoverlay',
config : {
modal : true,
hideOnMaskTap : true,
showAnimation : {
type : 'popIn',
duration : 250,
easing : 'ease-out'
},
hideAnimation : {
type : 'popOut',
duration : 250,
easing : 'ease-out'
},
centered : true,
width : 300,
height : 400,
//styleHtmlContent : true,
items : [ {
docked : 'top',
xtype : 'toolbar',
title : '测试'
}, {
xtype : 'list',
height : 290, // work
// flex : 1, //not work
itemTpl : '{name}---{age}',
store : 'mystoreid'
} ],
scrollable : true
}
});

浙公网安备 33010602011771号