Thanks, but I don't understand..how would I know when the insert (scheduler task) has completed?
On Thursday, January 2, 2014 11:14:00 AM UTC-8, Anthony wrote: > You can set a component to reload indefinitely and then stop the reloading > by doing: > > jQuery('#mydiv').addClass('w2p_component_stop'); > > However, in this case, rather than continually reloading the entire grid > while waiting for the database insert, it might be better to simply poll > the server every x seconds, and only when the insert has finally occurred, > then do a single reload of the grid. > > Anthony > > On Friday, December 20, 2013 1:24:00 PM UTC-5, EW wrote: >> >> I have a load component with a grid in it and a user-triggered action >> that could insert/update the database table that my grid's based on. >> Depending on many factors, the database insert could take a long time, say >> 45s+. I would like to update the view to show the updating grid while the >> inserts are going on rather than having a stagnant page that looks like >> it's not doing anything for 45s+. >> >> So I created a scheduler and am doing the db inserts in a scheduler >> task. But I'm not sure what the best way is to update the view. I know >> that I could use the 'times' and 'timeout' parameters in the LOAD. Or I >> could poll in javascript using setInterval to call web2py_component. But >> is it burdensome to always have my page updating this, say every second? >> The scheduler task for my db inserts only happen when the user clicks >> something; at all other times it is unnecessary to reload the grid. Is >> there a way to make the view constantly update on the user's click but once >> the scheduler task has completed (i.e. finished inserting into the >> database) to stop the view from updating? >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.