Jump to content

Recommended Posts

Posted

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')
            }
        })
    }
}

 

  • 2 weeks later...
Posted

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
            }
        })
    }
}
Posted
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;

 

  • 3 weeks later...
  • 2 weeks later...
Posted
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?

Posted

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);            
            }
                
            
        })
    }

Posted
22 hours ago, KingOrmon said:

if ( store.count() % 100 == 0 ) 
                ajaxRequest(sender, 'zAjaxScrollEnd', []);   

Can you check the condition again!?

Posted
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...

Posted

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 ?

Posted
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?

  • 2 weeks later...
Posted
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.

  • 2 weeks later...
Posted
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?

×
×
  • Create New...