javascript - dojo.destroy() make node empty, not delete it -
i've got table, dynamically adding , deleting rows. when need remove element, it's not deleting, it's make emty. here's remove function:
function remove() { dojo.foreach( dojo.query(".selectedmail"), function(selecttag) { dojo.destroy(selecttag); } ); }
here's selecting function:
var mybehavior = { ".row": { //onclick: dojo.addclass(evt.target, "buttondown") onmousedown: function(evt) { if(dojo.hasclass(evt.target, "selectedmail")) dojo.removeclass(evt.target, "selectedmail"); else dojo.addclass(evt.target, "selectedmail"); } } };
here's table:
<table> <tbody id="tbody123"> <tr class="row"> <td >simplesimplesimplesimplesimple</td> </tr> <tr class="row"> <td>simplesimplesimplesimplesimple</td> </tr> <tr class="row"> <td>simplesimple</td> </tr> <tr class="row"> <td>simple</td> </tr> </tbody> </table>
after remove() executing there remaining: here's full source: http://pastebin.com/0yn5tkvg
dojo.destroy
working fine, need examine dom more carefully. adding class of "selectedmail" td
element, dojo.destroy
removing element , (of course) leaving parent tr
element alone.
Comments
Post a Comment