-
14 Feb 2013 7:01 AM #1
List: ScrollToEnd causes PullRefreshPlugin to show up
List: ScrollToEnd causes PullRefreshPlugin to show up
REQUIRED INFORMATION Sencha Touch version tested:
- ST 2.1
ST 2.0 didn't have this problem Browser versions tested against:- Chrome 24.0.1312.57
- Safari 5.1.7
- <!DOCTYPE html>
- I have a list with a PullRefreshPlugin. If you have a small number of entries in
this list, so that there is white space below the entries, a call to scrollToEnd on the
list will cause the PullRefreshPlugin to show up (and stay there)
- Take the code below (it is the example code for the PullRefreshPlugin from the
docs + an invocation of list.scrollToEnd after 5 seconds - Execute it with your browser
at fullScreen - After 5
seconds you will see the PullRefreshPlugin on the screen
- You should see the PullRefreshPlugin only by user interaction I guess
- You see the PullrefreshPlugin
HELPFUL INFORMATION Screenshot or Video:Code:Ext.application( { launch: function() { var store = Ext.create('Ext.data.Store', { fields: ['name', 'img', 'text'], data: [ { name: 'edpsencer', img: 'http://a2.twimg.com/profile_images/1175591906/Ed-presenting-cropped_reasonably_small.jpg', text: 'Read about Sencha Touch' },{ name: 'rdougan', img: 'http://a0.twimg.com/profile_images/1261180556/171265_10150129602722922_727937921_7778997_8387690_o_reasonably_small.jpg', text: 'Javascript development' } ] }); var list = Ext.create('Ext.dataview.List', { fullscreen: true, store: store, plugins: [ { xclass: 'Ext.plugin.PullRefresh', pullRefreshText: 'Pull down for more new Tweets!' } ], itemTpl: [ '<img src="{img}" alt="{name} photo" />', '<div class="tweet"><b>{name}:</b> {text}</div>' ] }); setTimeout(function() { var scrollable = list.getScrollable(); if (!isValid(scrollable)) return; var scroller = scrollable.getScroller(); if (!isValid(scroller)) return; scroller.refresh(); scroller.scrollToEnd(); }, 5000); } });- attached
- The scrollToEnd seems to fire a kind of scroll event and the plugin react on this in
its onScrollChange method
- I can workaround this by inheriting from PullRefresh so that it doesn't react in
onScrollChange if it was invoked by my app. But this is quite ugly I guess.
- only default ext-all.css
- ________
- Windows 7
-
14 Feb 2013 7:33 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Thanks for the report! I have opened a bug in our bug tracker.
-
18 Feb 2013 11:59 PM #3
Maybe this is another bug I found and I should open another thread for this. But it seems to me that both are related:
I have a list without PullRefreshPlugin and only a few entries, so the screen is not filled completely. If I invoke scrollToEnd on the list, the list entries are moved to the bottom of the screen. Screenshot is attached.
Test code:
Code:var store = Ext.create('Ext.data.Store', { fields: ['name', 'img', 'text'], data: [ { name: 'rdougan', img: 'http://a0.twimg.com/profile_images/1261180556/171265_10150129602722922_727937921_7778997_8387690_o_reasonably_small.jpg', text: 'JavaScript development' } ] }); var list = Ext.create('Ext.dataview.List', { fullscreen: true, store: store, itemTpl: [ '<img src="{img}" alt="{name} photo" />', '<div class="tweet"><b>{name}:</b> {text}</div>' ] }); setTimeout(function() { var scrollable = list.getScrollable(); if (!isValid(scrollable)) return; var scroller = scrollable.getScroller(); if (!isValid(scroller)) return; scroller.refresh(); scroller.scrollToEnd(); }, 5000);
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3997
in
Sprint 31.


Reply With Quote