Deleting row doesn`t affect background data!

Deleting row doesn`t affect background data!

Luda AmebaLuda Ameba Posts: 11Questions: 0Answers: 0
edited March 2009 in Bug reports
Hi,
I have problem, when using fnDeleteRow. It clears the html row but when I call fnGetData the row is still there. If you print length of tableData it won`t decrease after fnDeleteRow function is called. :)
I am using dynamically adding and removing rows.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Luda,

    You are quite correctly in this. The reason for this is the the information about the row is deleted from the display arrays, but not the core data array. I do it this way because there are a number of internal and external utilities which depend on the indexing of the core data array (fnGetPosition for example). As such this isn't all that trivial to fix. I'll need to get back to you on this one... :-)

    Allan
  • naspinskinaspinski Posts: 13Questions: 0Answers: 0
    I have an example of how to do it here:
    http://naspinski.net/post/Deleting-Items-From-a-Table--REAL-AJAX-with-AspNet-Series.aspx

    It is with asp.net, but the JS is the same regardless
  • Luda AmebaLuda Ameba Posts: 11Questions: 0Answers: 0
    Solution for now is parallel data structure. It's not the best practice but it works :)
    @naspinski
    Good example but in my case table data are in local not on server side until I send them :)
This discussion has been closed.