oTable.fnDeleteRow(nRow) ?? nRow is a string
oTable.fnDeleteRow(nRow) ?? nRow is a string
mlotfi
Posts: 60Questions: 5Answers: 0
I have a problem, I want to delete a row from the table with fnDeleteRow , but I don't have an id number, just string, can you please help me on how to deal with this ?
IN HTML :
<tbody>
<logic:iterate id="mdataenv" name="metadataEnvList">
<tr id='<bean:write name="mdataenv" property="interfaceEnvironment"/>'>
<td><bean:write name="mdataenv" property="interfaceEnvironment"/></td>
<td><bean:write name="mdataenv" property="disabled"/></td>
<td><bean:write name="mdataenv" property="creatorId"/></td>
<td class="center"><ichtml:dtfmt vDate="${mdataenv.createdAt}"/></td>
<td><bean:write name="mdataenv" property="updaterId"/></td>
<td class="center"><ichtml:dtfmt vDate="${mdataenv.updatedAt}"/></td>
<td class="center">
<html:link href="JavaScript:void()" styleId="gglobal" styleClass="button delete" style="margin:10px;margin-right:30px;">Delete</html:link>
</td>
</tr>
</logic:iterate>
</tbody>
in JS :
var nRow = $(this).parents('tr')[0];
alert(nRow.id); <------------------ ------------------------------- is a string
oTable.fnDeleteRow(nRow);
edited by Allan Formatting
This discussion has been closed.
Replies
Check the documentation for
row().remove()
, when I test this using v1.10.4 the following works;The above example stores the row.node() differently to the documentation, but the end result is the same.
Agreed - use the new API for 1.10. However, the code you have looks like it show work just fine - you are passing in the node (not the id string - that has no relevance). If it isn't working, please link to a test case, as required in the forum rules.
Allan