Using Ext JS to create LiveDataPanel

javascript Add comments

Link: Using Ext JS to create LiveDataPanel

A commonly requested piece of functionality is to load additional data when scrolling to the bottom of a dataset. DZone is a popular technology news site that uses this type of functionality on their home page. As you scroll to the bottom of a page, a loading indicator displays and then loads new content. This is not a feature which Ext provides out of the box, however by leveraging existing Ext components the task becomes simple. I have created a widget to support this type of functionality named Ext.ux.LiveDataPanel.

LiveDataPanel

ExtJS出的通过滚动加载内容,和Google Reader的效果相同,一开始只加载部分数据,当滚动条拖动到最下边的时候,再去加载额外的数据。这里有Demo

Dojo也有这个功能,项目中已经使用一段时间了,稍微有点不同的是,在Dojo里会先计算出Grid的内容的高度,而不是每次拖动到最底端再加载。这样有个好处,不用一页一页的翻,可以直接拖动滚动条到任意位置,加载任意部分的数据。

这个LiveDataPanel使用也比较简单

// Creating the panel is easyvar p = new Ext.ux.LiveDataPanel({frame: true,title: 'Latest Blog Entries',

height: 400,

width: 590,

itemSelector: '.entry',

tpl: Ext.XTemplate.from('tplBlog'),

store: myStore

});

p.render('entry-list');
  • Share/Bookmark

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Leave a Reply


WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in