在 sencha touch 移动应用程序中无限(直到结束)显示缓冲内容
我有一个相当长的列表要在我的 sencha touch 移动应用程序中显示,由于列表的内容,该应用程序非常重,然后我发现 这个很棒的工具它极大提高了效率,但是这个库带来的问题是它会显示前 70 个项目,当你向下滚动它确实如此根本不显示东西。有没有人处理过。请告诉我。
下面提到的是测试代码示例,这将帮助您进行模拟。
Ext.reg('mylist', Ext.ux.BufferedList);
var data = [];
for (var i = 0; i < 600000; i++)
data.push({
firstName: 'Mark' + i,
lastName: 'Taylor'
});
Ext.setup({
onReady: function() {
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var store = new Ext.data.Store({
model: 'Contact',
data: data
});
new Ext.TabPanel({
layout: 'fit',
fullscreen: true,
scroll: 'vertical',
items: [{
title: 'MyPanel',
xtype: 'panel'},
{
title: 'MyList',
fullscreen: true,
xtype: 'mylist',
itemTpl: '{firstName} {lastName}',
store: store}]
});
}
});
I had a fairly long list to display in my sencha touch mobile app, due to the contents of the list, the app was pretty heavy and then i found this great tool it increased the efficiency drastically But the issue which comes with this library is that it would display the first 70 items, and when you scroll down it does not display things at all. Has anyone dealt with it. Please let me know.
Mentioned below is the sample of the test-code, which will help you simulate.
Ext.reg('mylist', Ext.ux.BufferedList);
var data = [];
for (var i = 0; i < 600000; i++)
data.push({
firstName: 'Mark' + i,
lastName: 'Taylor'
});
Ext.setup({
onReady: function() {
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var store = new Ext.data.Store({
model: 'Contact',
data: data
});
new Ext.TabPanel({
layout: 'fit',
fullscreen: true,
scroll: 'vertical',
items: [{
title: 'MyPanel',
xtype: 'panel'},
{
title: 'MyList',
fullscreen: true,
xtype: 'mylist',
itemTpl: '{firstName} {lastName}',
store: store}]
});
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://gist.github.com/1244583 我猜这就是您正在搜索的内容!
我所做的唯一更新是第 35 行!
https://gist.github.com/1244583 this is what you are searching i guess!!
the only updation i have made is in line 35!!