hi,
is it possible to have ajax callback return string type data?
e.g.
controllers
def callback_2(session_order, target_response):
... cutted
if int(total_debit) == int(total_credit):
#status = "Balance"
#status = str("Balance")
status = 1
else:
#status = "Unbalance"
#status = str("Unbalance")
status = 0
#return "jQuery('#status').html(%s);" % (status)
return "jQuery('#status').html(%s);" % (str(status) )
all comment is not worked (no errors occured, but the result is not shown),
when change it into integer type it can work (shown in views). any idea how
to achieve it using web2py way?
i know i can put another conditional in views for that, but i want to know
another way to achieve this
e.g.
views
{{if status == 1:}}
<td>{{=SPAN('Balance', _class = "text-success" ) }}
</td>
{{else:}}
<td>{{=SPAN('Unbalance', _class = "text-danger" ) }}
</td>
{{pass}}
thanks and best regards,
stifan
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.