Behaviour of fnDeleteRow changed from v1.7.0

Behaviour of fnDeleteRow changed from v1.7.0

zzsuzzsu Posts: 2Questions: 0Answers: 0
edited August 2010 in Bug reports
With v1.6.x, when delete a row by fnDeleteRow, for example fnDeleteRow[2], you can then delete the next row by fnDeleteRow[3].
With v1.7.x, you must call fnDeleteRow[2] again in order to delete the next row.

Is this behaviour intentional?

(I have registered a triger with fnRender for each row, I get oObj.iDataRow for fnDeleteRow using.)

[code]
...
{"fnRender": function(oObj){return fnRenderRemoveLink(oObj, '${url.for("%{action='removecomponent'}")}');}, "bSortable": false}
...

function fnRemove(sUrl, id, iRow)
{
jQuery.post(sUrl, {id: id}, function(data){
if(!fnHasError(data)){
oDataTable.fnDeleteRow(iRow);
}
}, 'json');
}

function fnRenderRemoveLink(oObj, sUrl)
{
var link = "

Replies

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Yup this is intentional I'm afraid: http://datatables.net/upgrade/1.7 . Sorry that it's causing your script a bit of a problem - but hopefully overall it will make DataTables easier to work with when deleting rows!

    To get around this... What you can do is to pass the TR element you want to be deleted into the fnRemove function. To do this, it's probably easier to use jQuery events, rather than DOM0 events (those it is possibly, you just need to use the event object and get the targetNode, and rather it back up to the TR).

    Allan
  • hans_jameshans_james Posts: 10Questions: 0Answers: 0
    edited November 2010
    Hello,

    i have a problem with fnDeleteRow.
    After fnDeleteRow the Datatable always redraw the Datatable and got new position.
    It is possible that Datatable not got new position ???

    i use in 1.6 fnDeleteRow(pos, null, true); that is not possible in 1.7.

    Hans
This discussion has been closed.