rtalmeida Posted June 8, 2019 Share Posted June 8, 2019 is it possible to capture the unidbgrid scroll event? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 8, 2019 Share Posted June 8, 2019 4 hours ago, rtalmeida said: is it possible to capture the unidbgrid scroll event? Hi, One possible solution: function afterCreate(sender) { // you can use 'scrollend' or 'scroll' events sender.getView().on('scrollend', function(view, scrollX, scrollY) { //ajaxRequest }); } Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted June 8, 2019 Author Share Posted June 8, 2019 Is it possible to give me an example with more details? I need that when scrolling the mouse the records accompany. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 8, 2019 Share Posted June 8, 2019 42 minutes ago, rtalmeida said: Is it possible to give me an example with more details? I need that when scrolling the mouse the records accompany. You can pass scroll positions: scrollX, scrollY Or what do you mean? Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted June 8, 2019 Author Share Posted June 8, 2019 I set an example in VCL and the same in Unigui GridUnigui.zip GridVcl.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 8, 2019 Share Posted June 8, 2019 37 minutes ago, rtalmeida said: I set an example in VCL and the same in Unigui GridUnigui.zip GridVcl.zip Need to analyze Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted June 8, 2019 Author Share Posted June 8, 2019 OK thank you Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted June 10, 2019 Author Share Posted June 10, 2019 Sorry to bother, but my client insists that it works as it is on the desktop, if it is not possible I will change the strategy Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 11, 2019 Share Posted June 11, 2019 I will analyze and try to give you a possible solution. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 11, 2019 Share Posted June 11, 2019 7 hours ago, rtalmeida said: Sorry to bother, but my client insists that it works as it is on the desktop, if it is not possible I will change the strategy Try this... function afterCreate(sender) { var grid = sender; sender.getView().on('scrollend', function(view, scrollX, scrollY) { var vTop = grid.view.el.getTop(), vBottom = grid.view.el.getBottom(), top, bottom, hHeight = grid.headerCt.getHeight(); Ext.each(grid.view.getNodes(), function(node) { if (!top && Ext.fly(node).getTop() > vTop) { top = grid.view.getRecord(node).data._r; } if (Ext.fly(node).getBottom() - Ext.fly(node).getHeight() < vBottom) { bottom = grid.view.getRecord(node).data._r; } }); if (top != 1) { top += 1; } bottom += 1; if (top == 1) { grid.getSelectionModel().select(0) } else if (bottom == grid.getStore().count()) { grid.getSelectionModel().select(grid.getStore().count()) } else { grid.getSelectionModel().select(Math.round((bottom + top) / 2)) } grid.ensureVisible(grid.getSelection()[0]); }); } Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted June 11, 2019 Author Share Posted June 11, 2019 He loses himself a little, but he has helped me a lot, thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.