[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
yep, but that's not playing fair ^_^ happy that you resolved the problem though. On Friday, August 2, 2013 2:49:00 PM UTC+2, Marco Prosperi wrote: > > > > the solution (simple as a solution must be) is changing the > 'cart_callback' to update the entire (always little) . Sorry, you > haven't pa

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Marco Prosperi
the solution (simple as a solution must be) is changing the 'cart_callback' to update the entire (always little) . Sorry, you haven't passed the test :-P thank you for your time! Marco On Friday, August 2, 2013 10:22:23 AM UTC+2, Niphlod wrote: > > well, given that you're not an expert on ja

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
well, given that you're not an expert on javascript events (:-P) I'd use response.js in both the add and the sub functions to trigger the changes in your total field. This is one of the reasons that pushed me to create a new web2py.js (will be available from 2.6.0) , but you need to be comfortab

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Marco Prosperi
I've started from the PosOnLine demo appliance. There with the 'add' and 'sub' buttons you can change the quantity of the products you want to buy, but there is no total. I've tried to add a total in the view so that when the the customer 'adds' a product both the quantity and the total changes

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
uhm. the change event must be hooked to an input that changes, not to a piece of the page ... let me understand: you have a page with a total that needs to be refreshed via ajax after having submitted with ajax the "add" or the "sub" function ? On Friday, August 2, 2013 12:45:17 AM UTC+2, Marco

[web2py] Re: ajax() infinite loop

2013-08-01 Thread Marco Prosperi
It was the first thing I tried, using the same view and the following script, but nothing happens in this case when the quantity changes. Maybe it interferes with the 'add' and 'sub' callbacks? jQuery(document).ready(function(){ jQuery('.e').change(function(){ jQuery('#910').slideToggl

[web2py] Re: ajax() infinite loop

2013-08-01 Thread Niphlod
well, you are hooking up to the event that gets fired every time an ajax request completes. you "trial" code just replace the fragment with a fixed value, but if you use ajax instead the ajaxstop will fire in a loop, and it's correct that it does it. Why are you hooking up to the ajaxstop event