So I have an init function defined something like this:
init: function() {
$("#editRow").click(function() {
<code>
}
$(".removeRow").click(function() {
<code>
}
}
So, I was wondering if there was any way for me to call the class method
removeRow
in the onclick event itself? Essentially what I want to do is call the class methodremoveRow
when my button gets clicked.var d = '<a href="javascript:void(0)" class="btn btn-xs btn-danger delete-new-row removeRow"><i class="material-icons md-18" title="Delete">delete</i></a>';
And whenever I click the button I get an error saying that removeRow()
is not defined. So I am trying to figure out a way to call removeRow from pressing the button.
- If I wanted to call
editRow
in a different onclick event, would I do it the same way asremoveRow
or would that require a different approach?
Thanks for the help!