cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

how to make the service know the page(grid widget) has scrolled to the bottom

贾良
1-Visitor

how to make the service know the page(grid widget) has scrolled to the bottom

   Hello everyone,

  

   I  use  an AutoRefresh widget and a  custom service (The service just accumulates and return a number,  the resulting number is  bind to the ScrollTop attribute to make the page(grid widget) scroll down every  ten seconds, everything is OK, but I wanna do some action  when the page(grid widget) has scrolled to the bottom (can't scroll down anymore ). I don't know how to make the service know the page(grid widget) has scrolled to the bottom.


         if anyone have some idea, please help me, thanks.

ACCEPTED SOLUTION

Accepted Solutions
jkaczynski
12-Amethyst
(To:贾良)

Hello,

There's no such OOTB function. To achieve the behavior like that, you need to make a small workaround.

Every grid has outbound property CurrentScrollTop (in pixels). So you know, that the end of the grid is reached, if CurrentScrollTop = ~((number_of_rows x row_height) - (number_of_displayed_rows * row_height)). That assumes that you know the number of rows in the IT and number of displayed rows.

Thanks and for you also - Happy New Year.

Regards,

J.

View solution in original post

5 REPLIES 5
jkaczynski
12-Amethyst
(To:贾良)

Hello,

Already responded in the other topic, but to make sure you noticed:

Hi,

Every service has event that is invoked when the invokation is finished - ServiceInvokeCompleted. If you need to chain any action after your service, it's a good place to start. The rest depends on your needs and what do you want to achieve.

To find this evet, just click on your service in the Mashup Builder - in the right bottom pane there are service properties and so the event,

Regards,

J.

Hi  Jakub ,

         Very thanks for your advice, but I  don't want do something when the invokation is finished, because the service may be invoked many times, only when the page(grid widget) has scrolled to the bottom to do some actions(such as redirect to another page). Chinese New Year is coming, Wish you a happy New Year.

jkaczynski
12-Amethyst
(To:贾良)

Hello,

There's no such OOTB function. To achieve the behavior like that, you need to make a small workaround.

Every grid has outbound property CurrentScrollTop (in pixels). So you know, that the end of the grid is reached, if CurrentScrollTop = ~((number_of_rows x row_height) - (number_of_displayed_rows * row_height)). That assumes that you know the number of rows in the IT and number of displayed rows.

Thanks and for you also - Happy New Year.

Regards,

J.

Hi ,

        Thanks for your advice. I don't think your solution is suitable for my current situation, because end users may use different resolution device access, but, according to your suggestion I got a good idea.

        Write a service, set the grid's ScrollTop(Property) bind to the result(the service)+=CurrentScrollTop, then use  Express widget or another service to judge whether the previous value(the service's result which binds to the grid ScrollTop property) and current value is the same, if they are same, shows that have reached the bottom.

sorry, the service's result=CurrentScrollTop's value + 100 (set the page scroll down 100px every 3 seconds)

Announcements


Top Tags