fnDeleteRow not removing fnAddRow
fnDeleteRow not removing fnAddRow
jmeyer
Posts: 3Questions: 0Answers: 0
I have some code that adds a row to the data table by passing the object into fnAddData function, the row renders perfectly. However, I have an .on('click') even that fires, reads the $(this).closest('tr') from the button that was clicked's data attribute, and attempts to delete the row on a successful ajax call. Everything works just fine except if I try to remove something that was added using fnAddData. Using the chrome debugger I can see that my jquery row object is found by the selector and is stored in the variable to be deleted. Any thoughts? This is an internal only site so I can't post a link up sorry :S (pastebin of all the js) http://pastebin.com/YYQWp2Zr
This discussion has been closed.
Replies
In my code posted above I am using a jquery object as my row identifier. As of the time of writing this that is not a valid option to pass to the functions. To fix the problem I just added [0] to the end of my jquery object to grab the first one (and in my case $object[0] will always exist... theoretically). Hopefully somewhere down the line JQuery object support gets added in but for now this little trick worked for me to get me going.