Ajax: periodicaly_call_remote problem


#1

Hello

I am using ‘periodically_call_remote’ to get some stats from database
and display it every N seconds, it’s works fine, but when I rewriting
(by page.replace …) content of the DIV which contains
‘periodically_call_remote’ definition request are still executing…
How to fix this confuse?

Thanks in advance.


#2

zven wrote:

Hello

I am using ‘periodically_call_remote’ to get some stats from database
and display it every N seconds, it’s works fine, but when I rewriting
(by page.replace …) content of the DIV which contains
‘periodically_call_remote’ definition request are still executing…
How to fix this confuse?

Thanks in advance.

You’re going to have to clarify your question to get a response from
this list. I’m not sure anyone understands what your problem is.


#3

On Wed, 2006-06-07 at 18:35 +0200, Alex W. wrote:

You’re going to have to clarify your question to get a response from
this list. I’m not sure anyone understands what your problem is.

How to stop periodically_call_remote?

Simple example:

View:

<%= link_to_remote 'Stop tracking', :url => { :action => 'stop' } %> <%= periodically_call_remote :url => { :action => 'track_all' }, :update => 'tracking' %>

Controller:

def track_something

DATABASE ACCESS HERE


render :partial => ‘track’
end

def stop
render :update do |page|
page.remove ‘view’
end
end

When ‘stop’ action executed, database access still work… It’s strange
isn’t it?