Unable to use fnDeleteRow when the row is not currently visible
Unable to use fnDeleteRow when the row is not currently visible
I have a reasonably complex application where users often use filters to view only
some of the rows, but a byproduct of some of their actions on those rows are to
add or delete other rows not visible in the current filter.
I can add the rows just fine, but cannot figure out how to delete rows that are not
currently visible. (I have read just about every discussion re fnDeleteRow , but
have not found what I should be doing .. ?)
There is a simple example to show this (using 1.9.2), and it also provides more background.
http://beachwatchers.net/example/dt1/
Thanks in advance for any advice you can give me.
Connie C
some of the rows, but a byproduct of some of their actions on those rows are to
add or delete other rows not visible in the current filter.
I can add the rows just fine, but cannot figure out how to delete rows that are not
currently visible. (I have read just about every discussion re fnDeleteRow , but
have not found what I should be doing .. ?)
There is a simple example to show this (using 1.9.2), and it also provides more background.
http://beachwatchers.net/example/dt1/
Thanks in advance for any advice you can give me.
Connie C
This discussion has been closed.
Replies
all the nodes to find the one with the matching DT_RowId.
Is there a more efficicient way to do this?
Thanks
- using fnGetNodes and looping over the array to find the matching DT_RowId,
and then using fnGetPosition to get the index to pass to fnDeleteRow, it works sometimes.
My array has 152 rows, but fnGetNodes is only returning 15 or so?
Probably the first 10 shown, plus the initial filter that returned 5.
If you know the ID of the row you want to delete then yes:
[code]
table.fnDeleteRow( table.$('#myRow')[0] );
[/code]
fnGetPosition should be avoided if you want (just because it adds an extra layer of complexity that you shouldn't need).
Allan
Do you have deferred rendering enabled?
in both my example/dt1 and in my real application (where I do have
deferred rendering enabled)
I had been using [code]
var el = document.getElementById('myRow');
table.fnDeleteRow(el);
[/code]
Thank you for you help, and your fantastic data table functionality.