fnDeleteRow() problem - bug or usage problem ?
fnDeleteRow() problem - bug or usage problem ?
Eran
Posts: 26Questions: 0Answers: 0
Hello Allan & fellow forum members,
I've encountered a strange problem using fnDeleteRow and decided to seek here some advice...
When I've tried using fnDeleteRow( [ TR element] ) to delete a certain row, the NEXT row was being deleted to the one I was actually passing as a parameter.
Then, I've decided to try and use an index parameter instead just to see what happens....
For example: fnDeleteRow(0).
What I found was that the second row (which is supposed to be index 1) was being deleted instead of the first row (index 0).
In general, fnDeleteRow was working with an +1 offset - deleting the next row which I didn't want to delete instead of the previous one.
It's like the rows index starts from the second row instead from the first row.
I have no idea what's causing this strange behavior. Bug? Usage problem?
Any ideas ?
I've encountered a strange problem using fnDeleteRow and decided to seek here some advice...
When I've tried using fnDeleteRow( [ TR element] ) to delete a certain row, the NEXT row was being deleted to the one I was actually passing as a parameter.
Then, I've decided to try and use an index parameter instead just to see what happens....
For example: fnDeleteRow(0).
What I found was that the second row (which is supposed to be index 1) was being deleted instead of the first row (index 0).
In general, fnDeleteRow was working with an +1 offset - deleting the next row which I didn't want to delete instead of the previous one.
It's like the rows index starts from the second row instead from the first row.
I have no idea what's causing this strange behavior. Bug? Usage problem?
Any ideas ?
This discussion has been closed.
Replies
Providing a test case is problematic for me since the computer I'm using for development isn't connected to the Internet.
I've tried deleting the row element using .remove() and it worked as a charm (for the UI anyway).
So I know for sure I'm passing the right TR element but something goes terribly wrong with the transition from the TRDataTableElement to an index...
I was passing a JQuery object instead of a DOM node without realizing I'm doing something wrong.
I thought the the API could take a JQuery object as well....
That was definitely a usage problem.
Problem solved.
Thank you :)
I've noticed that JQuery compatibility is coming in version 1.10. :)
Personally, I'd love to see Backbone js support as well.... maybe even as a feature plugin ?