我有分页的网格.每页最多有10行.像这样:
我在CSS中为.x-grid3-scroller选择器设置渐变背景.一切都很好,而DirectStore有10个项目.但如果物品少于10件我就有这个问题:
如果为.x-grid3-scroller设置条带背景,则列中将没有边框.
如何将空行添加到网格以使网格适合底部?
解决方法:
存储加载后(使用加载监听器)检查有多少条记录(getCount()方法)和add(add()方法)10 – store.getCount()空记录.
store.on('load', function(store) {
var records = new Array();
for(var i = 10 - store.getCount(); i > 0; i--) {
records.push(new store.recordType(/*you might need to provide default data here*/))
}
store.add(records);
});