-
23 Aug 2011 4:01 AM #61
Since my list is getting bigger and bigger, I forced myself to use this great extension. Seems to work very good, I only have a problem with the onItemdisclosure. It simply won't work. It will not go to the detailspane at all, I can't seem to figure out why this is the case:
Code:Ext.ns('ShotjesApp'); Ext.setup({ onReady : function() { Ext.regModel('Contact', { fields: ['Naam', 'Inhoud'] }); var baseConfig = { itemTpl: '<div><p><strong>{Naam}</strong></p></div>', grouped: true, // optional indexBar: true, // optional maxItemHeight: 75, // must specify blockScrollSelect: true, batchSize: 10, // not required, may require tweaking for some platforms store: new Ext.data.Store({ model: 'Contact', sorters: 'Naam', getGroupString : function(record) { return record.get('Naam')[0]; }, // data: ListTestData }) }; ShotjesApp.listPanel = new Ext.ux.BufferedList(Ext.apply(baseConfig, { fullscreen: true, id: 'listpanel', onItemDisclosure: function(record) { var naam = record.data.Naam; ShotjesApp.detailPanel.update(record.data); ShotjesApp.Viewport.setActiveItem(ShotjesApp.detailPanel, {type:'fade'}); ShotjesApp.detailPanel.dockedItems.items[0].setTitle(naam); } })); ShotjesApp.detailPanel = new Ext.Panel({ id: 'detailpanel', tpl: '{Inhoud}', layout: 'fit', scroll: false, dockedItems: [{ xtype: 'toolbar', dock: 'top', items: [{ text: 'terug', ui: 'back', handler: function() { ShotjesApp.Viewport.setActiveItem('listpanel', {type:'fade'}); } }] }], }); ShotjesApp.Viewport = new Ext.Panel ({ fullscreen: true, layout: 'fit', items: [ShotjesApp.listPanel, ShotjesApp.detailPanel] }); // test to see if data load is handled correctly ShotjesApp.listPanel.store.loadData(ListTestData); } });
-
23 Aug 2011 4:12 AM #62
You need to add a support (code below) for this event in initComponent() method of uxBuffList.
Code:// onItemDisclosure support this.itemTplDelayed = '<tpl for="."><div class="x-list-item"><div class="x-list-item-body">' + this.itemTpl + '</div>'; if (this.onItemDisclosure) { this.itemTplDelayed += '<div class="x-list-disclosure"></div>'; } this.itemTplDelayed += '</div></tpl>'; this.itemTplDelayed = new Ext.XTemplate(this.itemTplDelayed).compile(); // end onItemDisclosure support
-
23 Aug 2011 4:15 AM #63
-
23 Aug 2011 4:53 AM #64
Edit: Fixed the problem that it wouldn't show (just needed to moved the main JS file a few rows). Also fixed the problem it wouldn't show any items after 50 items. Needed to update the main JS file with some code I found here.
Now the only big problem remains. And that is the onitemdisclosure that just would not work at all, it is working when I make it the standard ext.List. And yes, the onItemDisclousre code is in the uxBufferlist.js file.
I can press all I want, it just won't go to the details pane..
This is my code:
(the iOS stuff at the top is to reduce the loadingtime/white flash problem)
The UxBufList.JS I use came from the previous page and is provided by Nikkelmann. It contains all the bug fixes and contains the ondisclosureitem code.Code:Ext.ns('ShotjesApp');Ext.setup({ onReady: function() { ShotjesApp.Main.init(); } }); if (Ext.is.iOS && Ext.is.Phone) { Ext.Viewport.init = function(fn, scope) { var me = this, stretchSize = Math.max(window.innerHeight, window.innerWidth) * 2, body = Ext.getBody(); me.updateOrientation(); this.initialHeight = window.innerHeight; this.initialOrientation = this.orientation; body.setHeight(stretchSize); Ext.defer(function() { me.scrollToTop(); if (fn) { fn.apply(scope || window); } me.updateBodySize(); }, 50); }; } ShotjesApp.listPanel = new Ext.ux.BufferedList ({ store: ListStore, id: 'listpanel', layout: 'fit', grouped: true, // optional indexBar: true, // optional maxItemHeight: 75, // must specify blockScrollSelect: true, batchSize: 10, // not required, may require tweaking for some platforms itemTpl: '<div><p><strong>{Naam}</strong></p></div>', onItemDisclosure: function(record) { var naam = record.data.Naam; ShotjesApp.detailPanel.update(record.data); ShotjesApp.listContainer.setActiveItem(ShotjesApp.detailPanel, {type:'fade'}); ShotjesApp.detailPanel.dockedItems.items[0].setTitle(naam); } }); ShotjesApp.detailPanel = new Ext.Panel({ id: 'detailpanel', tpl: '{Inhoud}', layout: 'fit', scroll: false, dockedItems: [{ xtype: 'toolbar', dock: 'top', items: [{ text: 'terug', ui: 'back', handler: function() { ShotjesApp.listContainer.setActiveItem('listpanel', {type:'fade'}); } }] }], }); ShotjesApp.listContainer = new Ext.Panel ({ layout: 'card', items: [ShotjesApp.listPanel], }) ShotjesApp.mainToolbar = new Ext.TabPanel ({ flex: 1, xtype: 'tabpanel', tabBar: { dock: 'bottom', layout: { pack: 'center' } }, ui: 'dark', cardSwitchAnimation: { type: 'fade', cover: true }, scroll: 'vertical', items: [{ title: 'Shotjes', iconCls: 'home', cls: 'card', layout: 'fit', items: ShotjesApp.listContainer }, { title: 'Informatie', iconCls: 'bookmarks', layout: 'fit', cls: 'card', html: 'Over deze applicatie', }] }) ShotjesApp.Main = { init : function() { new Ext.Panel({ fullscreen: true, layout: { type: 'fit', }, items: [ShotjesApp.mainToolbar] }); } };
EDIT: Seemed that I fixed the onDisclosureItem problem by adding this code in the index.js. I forgot I removed the disclosure button and changed my ext.list so the whole row would be clickable
Hopefully this will be it.Code:Ext.override(Ext.List, { afterRender: function(){ Ext.List.superclass.afterRender.call(this); if (this.onItemDisclosure) { this.mon(this.getTargetEl(), 'singletap', this.handleItemDisclosure, this, { delegate: '.x-list-item-body' }); } } });
Edit:
Also, the code for the onItemDisclosure breaks the Indexbar. Not a big problem for me, I don't' want to use it, but can of course be a problem for others.
This is the Javascript error: Uncaught TypeError: Cannot call method 'getCount' of undefined (line 634).
Edit:
I also notice some lag when scrolling fast through the list. And when I go to the detail pane (fade) and go back again, the fade transition is weird. It flickers and it seems the Buflist is loaded before the fade ends.
Edit:
Seems that all animations between the panels and the Buflist is weird. Doesn't happen in Chrome or the iPhone/iPad simulator. Only on my iPhone 4 device. Maybe someone knows how to fix this, I'm lost on this one.
-
26 Aug 2011 2:22 AM #65
Yeah that sounds like the problem I have. I don't use any images in the item list though. I do use a background-gradient, but when I disabled it it's still laggy like you describe. I guess you also have the same problems with the animations as I have. I wonder if you also have it on the iDevice only, and not in the browser/simulator.
I tried to figure it out for a few hours, but I can't seem to find the problem. The Ext.List component doesn't have this problem (however, loading times when clicking an item are horrible, so Bufferedlist is still the best solution).
Still hope someone can help.
-
31 Oct 2011 10:52 PM #66
Hi,
first of all, I want to say thank you for sharing this code with the community - it really helped me a lot!
Since I needed a component which deals with large data sets and also handles updates on the store in the view accordingly, I took a closer look at the BufferedList but I ran into some issues with the control: When the bound store is updated within a timer, the refresh method of BufferedList is called, which does not seem to handle the scroll position in the right way. That sometimes leads to a "white list scenario" (it seems to scroll into topProxy and/or bottomProxy area in some situations). I wrote some code to fix that issue (just trying to hit the right scroll position in refresh() function), but it does not seem to help in every update scenario - there were always situations, when the scroll position of the list was unexpectedly outside the bounds of listContainer element
.
So, after a lot of testing with BufferedList I decided to take some useful parts of the Ext.ux.BufferedList implementation and write my own component "Ext.ux.VirtualList" which definitely does not offer as many features as Ext.ux.BufferedList, but it handles updates on the store a bit better (IMO). The whole thing starts as an education project (I just wanted to learn writing my own components in Sencha Touch and implement my own concept of a list control ) but after a while it turns out to be useful in one of my projects, so maybe someone out there considers this code helpful too
. My List implementation should be an alternative, not a replacement - there are still many features missing in my implementation. Anyway: I want to share this code with you - maybe it is useful for other people like the BufferedList was useful to me in first place.
You can find the implementation of my list control (which I called "Ext.ux.VirtualList") here: https://github.com/pat777/VirtualList.
Hope you enjoy it! Have a nice day everybody!
-
15 Nov 2011 2:43 AM #67
Is there any roadmap to rebuild that component for Sencha Touch 2??
-
26 Nov 2011 2:50 PM #68
-
26 Nov 2011 9:18 PM #69
Great news!
Btw, ST2 does a really good job with large lists. ;o) But would be nice to have this component for really laaaarge lists.
greetings Sunny
-
9 Dec 2011 7:51 AM #70
Not showing full data in the list and getting blank screen while scrolling down
Not showing full data in the list and getting blank screen while scrolling down
Thanks for providing such a component. I tried this for populating large amount of data in a list from JSON STORE (more than 300) but after scrolling down (above 100 data's) not showing it in the list and getting scrolled with blank screen. Please help me out on this..
Similar Threads
-
tobiuGrid - High Performance EditorGrid
By tobiu in forum Community DiscussionReplies: 23Last Post: 21 Dec 2010, 8:10 PM -
ExtJS Grid, Poor Performance with High Frequency Updates?
By pkoa in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 17 Sep 2010, 5:36 AM -
Interesting high performance grid
By mankz in forum Community DiscussionReplies: 7Last Post: 21 Aug 2010, 1:59 PM -
ExtJS performance on large forms
By berend in forum Ext 2.x: Help & DiscussionReplies: 5Last Post: 12 May 2010, 5:54 AM -
[FIXED] [1.1.4] ComboBox PagingToolBar to high in the dropdown list
By mwojciechowski in forum Ext GWT: Bugs (1.x)Replies: 3Last Post: 26 Nov 2008, 9:12 PM


Reply With Quote