admin管理员组文章数量:1332395
I have the grid with paging. Every page has max 10 rows. Like this:
I set gradient background for .x-grid3-scroller selector in CSS. Everything is fine, while there is 10 items in the DirectStore. But if there is less items than 10 I have that problem:
If set striped background for .x-grid3-scroller there will be no borders in columns.
How to add empty rows to the grid to fit grid to the bottom?
I have the grid with paging. Every page has max 10 rows. Like this:
I set gradient background for .x-grid3-scroller selector in CSS. Everything is fine, while there is 10 items in the DirectStore. But if there is less items than 10 I have that problem:
If set striped background for .x-grid3-scroller there will be no borders in columns.
How to add empty rows to the grid to fit grid to the bottom?
Share Improve this question edited Aug 17, 2011 at 12:09 BUDDAx2 asked Aug 17, 2011 at 11:43 BUDDAx2BUDDAx2 3991 gold badge5 silver badges20 bronze badges1 Answer
Reset to default 5After store is load (use load
listener) check how many records are there (getCount()
method) and add (add()
method) 10 - store.getCount()
empty records.
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);
});
本文标签: javascriptHow to add empty rows to the ExtJS GridStack Overflow
版权声明:本文标题:javascript - How to add empty rows to the ExtJS Grid? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742283711a2446559.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论