我有一个在模板中有列的表:
<div id="petDiv">
<table>
<thead>
<tr>
<g:sortableColumn property="breed" title="${message(code: 'contact.breed.label', default: 'Breed')}" />
<g:sortableColumn property="age" title="${message(code: 'contact.age.label', default: 'Age')}" />
</tr>
</thead>
<tbody>
<g:each in="${availablePets}" status="i" var="pet">
<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
<td><g:link action="show" id="${pet.id}">${fieldValue(bean: pet, field: "Breed")}</g:link></td>
<td>${fieldValue(bean: pet, field: "Age")}</g:link></td>
<td>
<g:form>
<fieldset class="pDivB">
<g:remoteLink action="updatePet" update="another template here??" params: [] >Update</g:remoteLink>
</fieldset>
</g:form>
</td>
</tr>
</g:each>
</tbody>
</table>
</div>
我想:
Hit link
Go to updatePet method in Controller with the ID of that pet
Update my <td> tags for breed and age for that row only
我尝试使用我在线阅读的jQuery / Javascript组合,但它只更新了第一行。