Hi all,
I'm trying to have a ajax callback function whenever I click a certain row.
I'd like that row to return the id of the record the row represents.
I'm at loss as to the middle argument for the ajax function. I checked the
function in the controller gets called but the argument is wrong.
I created a simple example so I could try and traceback the problem but I
think I'm doing something wrong.
This is my view:
{{extend 'layout.html'}}
<table>
<tr class="row" id="1" onclick="ajax('echo', ['id'], ':eval')">
<td>Hello</td><td>World</td>
</tr>
<tr class="row" id="2" onclick="ajax('echo', ['id'], ':eval')">
<td>Row 2</td><td>New world</td>
</tr>
</table>
<div id="target"></div>
And the following is my controller:
def one():
return dict()
def echo():
return "jQuery('#target').html(%s);" % request.vars.id
What am I doing wrong?