API: Cannot add a new row after fnDeleteRow(..., ..., true) is called (Patch)

API: Cannot add a new row after fnDeleteRow(..., ..., true) is called (Patch)

kalakudukalakudu Posts: 3Questions: 0Answers: 0
edited March 2010 in Bug reports
Hi,

I came across this problem recently in my project: You cannot add another row via the API (fnAddData) once you've used the fnDeleteRow with the third parameter set to true. I am using v1.6.2 of DataTables and v1.4.2 of JQuery. I tested it in both FF3.6 and IE 8 with the same result.

The error is "'childNodes' is null or not an object" and happens on line 4434 of jquery.dataTables.js
[code]
for ( iColumn=0, iColumns=nTrs[iRow].childNodes.length ; iColumn

Replies

  • ian.fordian.ford Posts: 4Questions: 0Answers: 0
    Im having the same issue I remove the entry from the aoData array and then try to add a new row and it blows up on line 4434 of the jquery.dataTables.js (nTrs[iRow] is null)

    Ill try your solutions and see if that fixes the problem.
  • dahepedahepe Posts: 7Questions: 0Answers: 0
    Hi,

    what's the status of this bug? Is this issue being addressed? Or did any side effects come up by this quickfix?

    I'm having the same problem (delete row, add row and nTrs[iRow] is null). Is there perhaps any other way to determine if a row was deleted without nulling the aoData entry (i.e. calling fnDeleteRow with bNullRow set to false)? This would be required to transfer the actual data (without deleted rows) from the page back to the server again...

    cheers
  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin
    Try using 1.7 beta 5. In the 1.7 series simply nulling the data array is no longer done, but rather it is properly removed. The header for fnDelete is now:

    fnDeleteRow = function( mTarget, fnCallBack, bRedraw )

    (i.e. no option for bNullRow).

    If you could let us know how you get on...!

    Regards,
    Allan
  • dahepedahepe Posts: 7Questions: 0Answers: 0
    Hi allan,

    just gave 1.7.0 beta 5 a try (as mentioned in the update notes simply a one drop replacement and adjustment of the fnDeleteRow-call). Haven't had any issues with this version till now. Especially this null row issue is no issue any longer.

    I'm a little concerned about the beta status of this version. We are planning to deploy it in a production environment in about 1-2 month and the term beta is not something a normal customer wants to see :-). How does this version compare to 1.6.2 in terms of stability? And do you have some kind of release date/schedule for the first non-beta 1.7.0 version?

    Best regards and keep up the impressive work!!
  • allanallan Posts: 57,236Questions: 1Answers: 9,113 Site admin
    Hi dahepe,

    I plan to release 1.7 beta 6 in the next day or two - just one or two little issues that I want to get worked out. That will hopefully be the last beta in the 1.7 series, and 1.7.0 will be released (I hope) next week (baring something really bad happening...).

    With the beta 6 release I would say that 1.7 is significantly more stable that 1.6.2. If you have a look at the release notes you'll see that there are a raft of bug fixes in this beta series which I don't plan on back porting to 1.6.x. The one thing which has been unstable in 1.7 beta is the alignment of the columns when enabling the new scrolling feature. However I believe I have that licked now :-)

    Regards,
    Allan
This discussion has been closed.