KingOrmon Posted November 7, 2020 Posted November 7, 2020 Hello, I would like to detect via JS when user scroll to the end of list. (when list bounces beceause no more data) Any idea ?
Sherzod Posted November 7, 2020 Posted November 7, 2020 Hello, 2 hours ago, KingOrmon said: I would like to detect via JS when user scroll to the end of list. (when list bounces beceause no more data) function afterCreate(sender) { let scroller = sender.getScrollable(); if (scroller) { scroller.on('scrollend', function(a, b, c) { if (scroller.getMaxPosition().y == c) { //ajaxRequest alert('end') } }) } }
KingOrmon Posted November 18, 2020 Author Posted November 18, 2020 How can I scroll to end a TunimDBListGrid ? function afterCreate(sender) { let scroller = sender.getScrollable(); if (scroller) { scroller.on('scrollend', function(a, b, c) { if (scroller.getMaxPosition().y == c) { ajaxRequest(sender, 'getProducts', []); // get product list scroller.scrollTo(0, 10000000, []); //it does nothing } }) } }
Sherzod Posted November 18, 2020 Posted November 18, 2020 6 hours ago, KingOrmon said: How can I scroll to end a TunimDBListGrid ? Hello, Try this approach: 1. function afterCreate(sender) { let me = sender; me.scrollToEnd = function() { me.select(me.getStore().last(), true); me.ensureVisible(me.getStore().last()) } } 2. Usage procedure TMainmForm.UnimButton1Click(Sender: TObject); begin with UnimDBListGrid1.JSInterface do JSCall('scrollToEnd', []) end;
KingOrmon Posted December 9, 2020 Author Posted December 9, 2020 Hi, I have noticed that scrollend event not firing on Android devices using chrome. Any idea ?
KingOrmon Posted December 18, 2020 Author Posted December 18, 2020 @Sherzod Hi, I have noticed that scrollend event not firing on Android devices using chrome. Any idea ?
Sherzod Posted December 18, 2020 Posted December 18, 2020 Just now, KingOrmon said: I have noticed that scrollend event not firing on Android devices using chrome. Hi, I will check.
Sherzod Posted December 18, 2020 Posted December 18, 2020 4 minutes ago, KingOrmon said: I have noticed that scrollend event not firing on Android devices using chrome. Can you make a simple testcase for this?
KingOrmon Posted December 18, 2020 Author Posted December 18, 2020 Nothing special, Place a UnimDBListGrid1 and add event: function afterCreate(sender) { let scroller = sender.getScrollable(); if (scroller) { scroller.on('scrollend', function(a, b, c) { if (scroller.getMaxPosition().y == c) { var store = sender.getStore(); console.log(store.count()); if ( store.count() % 100 == 0 ) ajaxRequest(sender, 'zAjaxScrollEnd', []); console.log(store.count() % 100); } }) } }
Sherzod Posted December 19, 2020 Posted December 19, 2020 22 hours ago, KingOrmon said: if ( store.count() % 100 == 0 ) ajaxRequest(sender, 'zAjaxScrollEnd', []); Can you check the condition again!?
KingOrmon Posted December 21, 2020 Author Posted December 21, 2020 The problem is that scrollend not fires under redmi 9 chrome, on iphone and web works well
Sherzod Posted December 21, 2020 Posted December 21, 2020 2 hours ago, KingOrmon said: The problem is that scrollend not fires under redmi 9 chrome, on iphone and web works well Hello, Could you please create a test case? Although I have already tested on mobile devices (android) and it works...
KingOrmon Posted December 21, 2020 Author Posted December 21, 2020 Reviewing it I see that this condition never happens on android if (scroller.getMaxPosition().y == c) using console log I get values like this: scroller.getMaxPosition().y = 4295 c = 4294.9032344 Is it normal ?
Sherzod Posted December 21, 2020 Posted December 21, 2020 6 minutes ago, KingOrmon said: Reviewing it I see that this condition never happens on android if (scroller.getMaxPosition().y == c) using console log I get values like this: scroller.getMaxPosition().y = 4295 c = 4294.9032344 Is it normal ? Please make a simple testcase. 7 minutes ago, KingOrmon said: Reviewing it I see that this condition never happens on android How do you test this?
KingOrmon Posted December 21, 2020 Author Posted December 21, 2020 Using chrome > remote devices > inspect
Sherzod Posted January 1, 2021 Posted January 1, 2021 On 12/21/2020 at 4:06 PM, KingOrmon said: Reviewing it I see that this condition never happens on android if (scroller.getMaxPosition().y == c) using console log I get values like this: scroller.getMaxPosition().y = 4295 c = 4294.9032344 Is it normal ? Hello, Please make a complete test case to check.
KingOrmon Posted January 4, 2021 Author Posted January 4, 2021 I attach a modified fish demo. FishFact (DBListGrid).zip
Sherzod Posted January 4, 2021 Posted January 4, 2021 1 hour ago, KingOrmon said: I attach a modified fish demo. FishFact (DBListGrid).zip 12.64 kB · 0 downloads Hello, OK, and what doesn't work here?
KingOrmon Posted January 14, 2021 Author Posted January 14, 2021 Hello The problem is that scrollend not fires under android device redmi 9 chrome, on iphone and web works well
Sherzod Posted January 14, 2021 Posted January 14, 2021 43 minutes ago, KingOrmon said: The problem is that scrollend not fires under android device redmi 9 chrome Hi, Dear forum Users. Could you also test?
Recommended Posts