Hybrid View
-
1 Jul 2011 3:52 AM #1
Extjs 4, grid.getView().on('bodyscroll', function(event, target)
Extjs 4, grid.getView().on('bodyscroll', function(event, target)
There are 2 tables with same number of notes and joint store. It is nesessury to synchronize the position of vertical scroll and the current line.
For extjs3 the code was
For extjs4 I did the following (I had to enter additional conditions to avoid resonance)Code:grid1.on('bodyscroll', function(scrollLeft, scrollTop){ grid2.getView().scroller.scrollTo('top', scrollTop); }); grid2.on('bodyscroll', function(scrollLeft, scrollTop){ grid1.getView().scroller.scrollTo('top', scrollTop); });
But for example whole scrolling under IE7 foc_el - null . Is there any optimal method?Code:Ext.FocusManager.enable(); ... grid1.getView().on('bodyscroll', function(event, target){ var foc_el = Ext.FocusManager.focusedCmp; if (foc_el) { if ((foc_el.id=='grid1')|| (foc_el.id == grid1.getView().id)) { grid2.setScrollTop(target.scrollTop); } } }); grid2.getView().on('bodyscroll', function(event, target){ var foc_el = Ext.FocusManager.focusedCmp; if (foc_el) { if ((foc_el.id=='grid2')|| (foc_el.id == grid2.getView().id)) { grid1.setScrollTop(target.scrollTop); } } });
Sorry for my english.
-
1 Jul 2011 6:26 AM #2
Question in unequivocal definition of focus of the current table.
-
1 Jul 2011 9:24 AM #3
Code:grid_ds_deliv.getView().on('bodyscroll', function(event, target){ if (gl_gscr=='') gl_gscr = 'g1'; if (gl_gscr == 'g1') grid_ds_pld.setScrollTop(target.scrollTop); gl_gscr = ''; }); grid_ds_pld.getView().on('bodyscroll', function(event, target){ if (gl_gscr=='') gl_gscr = 'g2'; if (gl_gscr == 'g2') grid_ds_deliv.setScrollTop(target.scrollTop); gl_gscr = ''; });
-
31 May 2012 1:42 AM #4
I ran into same issue. What is the solution to this problem?
-
30 Nov 2012 9:54 AM #5
My solution FWIW
My solution FWIW
Code:dataGrid.getView().on('bodyscroll', function (event,target) { gridA.scrollByDeltaY(target.scrollTop - gridB.getView().getEl().getScroll().top); }); entryGrid.getView().on('bodyscroll', function (event, target) { gridB.scrollByDeltaY(target.scrollTop - gridA.getView().getEl().getScroll().top); });



Reply With Quote