如何向ExtJS Grid添加空行?

BUD*_*Ax2 5 javascript grid extjs rows

我有分页的网格.每页最多有10行.像这样: 在此输入图像描述

我在CSS中为.x-grid3-scroller选择器设置渐变背景.一切都很好,而DirectStore有10个项目.但如果物品少于10件我就有这个问题: 在此输入图像描述

如果为.x-grid3-scroller设置条带背景,则列中将没有边框.

如何将空行添加到网格以使网格适合底部?

Mch*_*chl 5

存储加载后(使用load监听器)检查有多少记录(getCount()方法)和添加(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);
});
Run Code Online (Sandbox Code Playgroud)