If you return JQuery script - not need to use any view template
DIV( ... _onclick = "ajax(%s, [name1, name2, ...], ':eval');" % URL(controller,
'calback_0')
def callback_0():
return '$(...)'
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py
for anthony's post, i think you can see it in the web2py google groups. he
explain detail about this. for your another question, this is my full code
of the cutted code above that work.
*modules/transaction.py*
def callback_0(session_order):
id = int(current.request.vars.id)
if current.request.va
On Thursday, May 21, 2015 at 4:06:07 PM UTC-7, 黄祥 wrote:
>
> I don't understand why you have the same calculation in your controller
>> and your view,
>>
>
> not sure what do you mean about calculation, i think is about variable
> definition (status and value) i define it on controllers and vi
>
> I don't understand why you have the same calculation in your controller
> and your view,
>
not sure what do you mean about calculation, i think is about variable
definition (status and value) i define it on controllers and views
e.g.
1. if i'm not define the variable status and value in vi
On Wednesday, May 20, 2015 at 10:41:16 PM UTC-7, 黄祥 wrote:
>
> hi,
>
> is it possible to have ajax callback return that update css value?
> e.g.
> *controller*
> def callback_2(session_order):
> """ cutted """
> if int(total_debit) == int(total_credit):
> status = 'Balance'
> value = 'text-succes
that's do the trick, thank you so much anthony for your help.
e.g.
*controllers*
return "jQuery('#status').html('%s');
jQuery('#status').removeClass().addClass('%s');" % (status, value)
*views*
{{if total_debit == total_credit:}}
{{status = "Balance" }}
{{value = "text-success" }}
{{=SPAN(status,
I think there are two problems. First, the class of an element is not a CSS
property, so you probably have to use removeClass and addClass. Second, you
have attempted to pass the Python "value" variable directly into the
Javascript code rather than use string formatting as you (properly) did
wi
7 matches
Mail list logo