[Seaside] how to stopInterval which was created by JSObject>>interval:

Sabine Manaa manaa.sabine at gmail.com
Tue Apr 25 09:21:01 UTC 2017


Hi,

I use JSObject>>interval: (thanks Johan) for my report generation:
first I show a spinner. Every 2 seconds, I try to reload the reports png
file (it takes a little time to generate it).
This works but I have one final problem: how can I stop the interval?
Four intervals are started each time the user selects a trip and wants the
reports to be shown (there are 4 report types currently). I have to stop
them, if not, they overlap with the old reports.

Below is a part of the code I use. As far as I understand, I need an ID of
the interval to call clearInterval(timerId); In the onComplete: of the load
I want to call clearInterval() with this timerId.
html div
...
script:
((html jQuery id: anId) load
html: [ :r |
...show the report file... ];
interval: 2 seconds);

It creates this JS

setInterval(function(){$("#imageVehicleReport").load("/RKA",["_s=sW0fUJ73IwxSs_bo","_k=b14htm7FJ6AWvWeW","4152"].join("&"))},2000)

How can I stop it?

Regards
Sabine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20170425/44d4fe2e/attachment.html>


More information about the seaside mailing list