-
16 Nov 2011 9:07 AM #1
Unanswered: Scroll Events in TouchGridPanel
Unanswered: Scroll Events in TouchGridPanel
Hi ,
I wanted to capture "Scroll" event of the TouchGridPanel.
Any ideas, pointers for the same?
My requirement is to make 1st column of grid freeze. So am trying to put 1 list and touchGridPanel in a Panel.
Now I have captured scroll event of the list and accordingly setting offset for the Grid as well.
rptList.scroller.on('scroll', scrollGrid);
But vice-versa for the grid is not working.. i.e when am scrolling grid, the function is not getting called.
grid.scroller.on('scroll', scrollList);
Please advice.
Thanks in advance.
-
17 Nov 2011 12:24 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3102
All the TouchGridPanel is is a Panel with a DataView. So get the scroller on the dataview and listen to it's events.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
14 May 2012 4:32 AM #3
Hi,
I am trying to capture Scroll event on TouchGridPanel .
As per suggestion, I did the following code but on scroll
it is not at all coming tostartScroll function.neither it is giving any error.
Could you please point out the mistake or any pointer. Thanks in advance.
Code:Ext.ux.TouchGridPanel = Ext.extend(Ext.Panel, { layout : "fit", multiSelect : false, scroll : "both", initComponent : function() { var me = this; me.items = me.dataview = me.buildDataView(); if (!Ext.isArray(me.dockedItems)) { me.dockedItems = []; } me.header = new Ext.Component(me.buildHeader()); me.dockedItems.push(me.header); Ext.ux.TouchGridPanel.superclass.initComponent.call(me); var store = me.store; store.on("update", me.dispatchDataChanged, me); var dataview = me.dataview; dataview.on("scroll", me.startScroll, me); }, startScroll: function (scroller, offset) { console.log('is this event captured???') var me = this; me.fireEvent("scroll", this.scroller, offset); },
-
14 May 2012 6:36 AM #4
Hi
Update to previous post.
I guess, can listen to scroll event only after data loaded.
before that var scroller = me.dataview.scroller; is always NULL.
I tried to get the scroller after the grid data loaded.
i.e @ where am displaying grid
But still am not able to capture scroll event when i scroll Grid.Code:var grid1 = new Ext.ux.TouchGridPanel({ .... gridStore.on('load', function() { grid1.scroller.on('scroll', function(){ console.log('is this event captured???'); }); }
-
22 May 2012 5:44 AM #5
Hi,
just to update, i managed to scroll the grids.


Reply With Quote