Spring Reload on TableViews

Hey,

I’ve been playing around with the tutorial on TableViews posted here: (https://coronalabs.com/blog/2014/03/04/tutorial-advanced-tableview-tactics/) Especially the spring reload is something I wanted to try out and this came in quite handy. However, when running the code it came back with bunch of errors. After going through the data model of the event it seemed to me that it had changed drastically since the tutorial was created.

After going through some of the documentation and a lot more parsing, I think I cam up with a solution. This is just the listener function, for the rest please refer to the tutorial

 local function scrollListener( event ) if event.direction == "down" and event.limitReached then if (event.target.\_prevYPos-event.target.\_startYPos) \> display.contentHeight \* 0.4 then reload() end end end

It’s working for me, just wanted to get some of your experiences.

Cheers

Georg

Hey,

I’ve been playing around with the tutorial on TableViews posted here: (https://coronalabs.com/blog/2014/03/04/tutorial-advanced-tableview-tactics/) Especially the spring reload is something I wanted to try out and this came in quite handy. However, when running the code it came back with bunch of errors. After going through the data model of the event it seemed to me that it had changed drastically since the tutorial was created.

After going through some of the documentation and a lot more parsing, I think I cam up with a solution. This is just the listener function, for the rest please refer to the tutorial

local function scrollListener( event ) if event.direction == “down” and event.limitReached then if (event.target._prevYPos-event.target._startYPos) > display.contentHeight * 0.4 then reload() end end end

It’s working for me, just wanted to get some of your experiences.

Cheers

Georg

Thank you Georg…I’m using your suggested fix and it’s working great!

Hey,

I’ve been playing around with the tutorial on TableViews posted here: (https://coronalabs.com/blog/2014/03/04/tutorial-advanced-tableview-tactics/) Especially the spring reload is something I wanted to try out and this came in quite handy. However, when running the code it came back with bunch of errors. After going through the data model of the event it seemed to me that it had changed drastically since the tutorial was created.

After going through some of the documentation and a lot more parsing, I think I cam up with a solution. This is just the listener function, for the rest please refer to the tutorial

local function scrollListener( event ) if event.direction == “down” and event.limitReached then if (event.target._prevYPos-event.target._startYPos) > display.contentHeight * 0.4 then reload() end end end

It’s working for me, just wanted to get some of your experiences.

Cheers

Georg

Thank you Georg…I’m using your suggested fix and it’s working great!