Servant5166 Posted February 21, 2018 Share Posted February 21, 2018 How can I goto the next page using the TUniDBGrid after scrolling to the last record in a page? I'm trying to create a continuous scroll action using the DBGrid. Thanks. Quote Link to comment Share on other sites More sharing options...
picyka Posted February 21, 2018 Share Posted February 21, 2018 http://forums.unigui.com/index.php?/topic/9925-dbgrid-with-ext-66/?hl=4.2&do=findComment&comment=52214 maybe it will help. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 21, 2018 Share Posted February 21, 2018 Hi, Also for "next" you can try to use this solution I think: UniDBGrid -> ClientEvents -> ExtEvents -> function afterrender: function afterrender(sender, eOpts) { var me = sender; me.view.getEl().on('scroll', function(e, t) { if (t.scrollHeight - (t.scrollTop + me.view.el.getHeight()) == 0) { if (me.pagingBar) { me.pagingBar.moveNext() } } }); } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 21, 2018 Share Posted February 21, 2018 For both: function afterrender(sender, eOpts) { var me = sender; me.view.getEl().on('scroll', function(e, t) { if (t.scrollHeight - (t.scrollTop + me.view.el.getHeight()) == 0) { if (me.pagingBar) { me.pagingBar.moveNext() } } else if (t.scrollTop == 0) { if (me.pagingBar) { me.pagingBar.movePrevious() } } }); } Quote Link to comment Share on other sites More sharing options...
Servant5166 Posted February 21, 2018 Author Share Posted February 21, 2018 For both: function afterrender(sender, eOpts) { var me = sender; me.view.getEl().on('scroll', function(e, t) { if (t.scrollHeight - (t.scrollTop + me.view.el.getHeight()) == 0) { if (me.pagingBar) { me.pagingBar.moveNext() } } else if (t.scrollTop == 0) { if (me.pagingBar) { me.pagingBar.movePrevious() } } }); } It works well. Thank you so much! Quote Link to comment Share on other sites More sharing options...
nandrianakis Posted August 9, 2018 Share Posted August 9, 2018 Is there any similar for unimdbgrid? Quote Link to comment Share on other sites More sharing options...
AdilsonReis Posted October 25, 2018 Share Posted October 25, 2018 On 2/21/2018 at 7:59 PM, Servant5166 said: It works well. Thank you so much! hello for: UnimDBListGrid2 ... Any solution???? Quote Link to comment Share on other sites More sharing options...
leons Posted October 25, 2018 Share Posted October 25, 2018 Doesn't seem to work in version, extjs 6.6.0 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 26, 2018 Share Posted October 26, 2018 9 hours ago, leons said: Doesn't seem to work in version, extjs 6.6.0 Hello, Maybe as a "workaround", try: 1. "pagingBar": function pagingBar.beforechange(sender, page, eOpts) { sender.isAfterScroll=false; } function pagingBar.change(sender, pageData, eOpts) { Ext.defer(function() { sender.isAfterScroll=true; }, 200); } 2. "panel": function afterrender(sender, eOpts) { var me = sender; me.view.getEl().on('scroll', function(e, t) { if (me.pagingBar.isAfterScroll) { if (t.scrollHeight - (t.scrollTop + me.view.el.getHeight()) == 0) { if (me.pagingBar) { me.pagingBar.moveNext(); } } else if (t.scrollTop == 0) { if (me.pagingBar) { me.pagingBar.movePrevious(); } } } }); } Quote Link to comment Share on other sites More sharing options...
ainsama1 Posted October 30, 2018 Share Posted October 30, 2018 On 2/22/2018 at 3:41 AM, Sherzod said: For both: function afterrender(sender, eOpts) { var me = sender; me.view.getEl().on('scroll', function(e, t) { if (t.scrollHeight - (t.scrollTop + me.view.el.getHeight()) == 0) { if (me.pagingBar) { me.pagingBar.moveNext() } } else if (t.scrollTop == 0) { if (me.pagingBar) { me.pagingBar.movePrevious() } } }); } Is there a way to apply this approach on Mobile? Specifically in UnimDbListGrid? @Sherzod Quote Link to comment Share on other sites More sharing options...
TNT23 Posted December 21, 2018 Share Posted December 21, 2018 Dear sir, I am evaluating unigui and i haven't found a way to make unimdbgrid move to next and previous page using a form button. This is important for our company to move on buying unigui . Even if this can't be done UNIGUI is a unique component for delphi developers. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 21, 2018 Share Posted December 21, 2018 1 hour ago, TNT23 said: I am evaluating unigui and i haven't found a way to make unimdbgrid move to next and previous page using a form button. This is important for our company to move on buying unigui . Even if this can't be done UNIGUI is a unique component for delphi developers. Which build are you using? Quote Link to comment Share on other sites More sharing options...
TNT23 Posted December 21, 2018 Share Posted December 21, 2018 Unigui v 1.0.0.1397 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 21, 2018 Share Posted December 21, 2018 33 minutes ago, TNT23 said: Unigui v 1.0.0.1397 I'm sorry, you've been using the pirated version for a long time. Quote Link to comment Share on other sites More sharing options...
TNT23 Posted December 21, 2018 Share Posted December 21, 2018 (edited) I am sorry to hear it is a pirated version. I really didn't know that. I am going to uninstall right now. Is there a demo version i can install sir. ok i found it http://www.unigui.com/component/rsfiles/download?path=FMSoft_uniGUI_Complete_Professional_1.50.0.1482_Trial.exe thank you Edited December 21, 2018 by TNT23 Found solution Quote Link to comment Share on other sites More sharing options...
TI.ME Posted December 21, 2018 Share Posted December 21, 2018 On 10/26/2018 at 3:51 AM, Sherzod said: Hello, Maybe as a "workaround", try: 1. "pagingBar": function pagingBar.beforechange(sender, page, eOpts) { sender.isAfterScroll=false; } function pagingBar.change(sender, pageData, eOpts) { Ext.defer(function() { sender.isAfterScroll=true; }, 200); } 2. "panel": function afterrender(sender, eOpts) { var me = sender; me.view.getEl().on('scroll', function(e, t) { if (me.pagingBar.isAfterScroll) { if (t.scrollHeight - (t.scrollTop + me.view.el.getHeight()) == 0) { if (me.pagingBar) { me.pagingBar.moveNext(); } } else if (t.scrollTop == 0) { if (me.pagingBar) { me.pagingBar.movePrevious(); } } } }); } For the previous page, it worked ... But it did not work for the next page. Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted June 18, 2020 Share Posted June 18, 2020 Any solution? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 18, 2020 Share Posted June 18, 2020 3 minutes ago, Daha Software said: Any solution? Solution for what? Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted June 18, 2020 Share Posted June 18, 2020 For the previous page, it worked ... But it did not work for the next page. function afterrender(sender, eOpts) { var me = sender; me.view.getEl().on('scroll', function(e, t) { if (me.pagingBar.isAfterScroll) { if (t.scrollHeight - (t.scrollTop + me.view.el.getHeight()) == 0) { if (me.pagingBar) { me.pagingBar.moveNext(); } } else if (t.scrollTop == 0) { if (me.pagingBar) { me.pagingBar.movePrevious(); } } } }); } Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted June 18, 2020 Share Posted June 18, 2020 This not worker me.pagingBar.moveNext(); Quote Link to comment Share on other sites More sharing options...
PS1 Posted January 23 Share Posted January 23 On 10/30/2018 at 6:19 AM, ainsama1 said: Is there a way to apply this approach on Mobile? Specifically in UnimDbListGrid? @Sherzod Is there solution for this question ? i need it badly too.. i found part of solution: DBGrid.WebOptions.PageSize := DBGrid.WebOptions.PageSize + 10 I dont know where and how should i check scrolling position and use ajaxrequest for the code above. Quote Link to comment Share on other sites More sharing options...
PS1 Posted January 23 Share Posted January 23 ok, solution found : function afterCreate(sender) { let scroller = sender.getScrollable(); if (scroller) { scroller.on('scrollend', function(a, b, c) { if (scroller.getMaxPosition().y <= c) { ajaxRequest(sender, 'ScrollBottomEvent', []); } }) } } procedure TmForm.DBGridAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'ScrollBottomEvent' then begin DBGrid.WebOptions.PageSize := DBGrid.WebOptions.PageSize + 10 end; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 23 Share Posted January 23 Very good. Quote Link to comment Share on other sites More sharing options...
PS1 Posted January 23 Share Posted January 23 Can it be done without using ajax function ? what i mean is: Can ,,DBGrid.WebOptions.PageSize := DBGrid.WebOptions.PageSize + 10" be written in ,,function afterCreate" ? I want to simplify code as much as possible. 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.