fnDeleteRow not removing fnAddRow

fnDeleteRow not removing fnAddRow

jmeyerjmeyer Posts: 3Questions: 0Answers: 0
edited March 2014 in DataTables 1.9
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

Replies

  • jmeyerjmeyer Posts: 3Questions: 0Answers: 0
    OK, just thought i'd post back, actually came across the answer while trying to solve another problem I ran into.

    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.
This discussion has been closed.