How can I get datatable selected row number

How can I get datatable selected row number

BennyxuBennyxu Posts: 22Questions: 3Answers: 0

I want to update one column data in the selected row, I am using fnUpdate method, while it required row and column index number,
for new row, I can get the total number, but for selected row, I can not get the row number, thanks a lot.

Replies

  • BennyxuBennyxu Posts: 22Questions: 3Answers: 0

    is there anybody help me, it is urgent to me, appreciated!!

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Hi,

    Using the old API you could use fnGetPosition to get the row index and that can be used to pass into fnUpdate . Alternatively, fnUpdate will accept the tr element (note the node not a jQuery instance) if you have a reference to that?

    Allan

  • BennyxuBennyxu Posts: 22Questions: 3Answers: 0

    allen, thanks, you are always resolving my key issues in time^^
    I don't have related reference, could you pls send one to me at you convenience,

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    By "[do] you have a reference to that" I simply meant in the code = i.e. $('#myElement')[0].

    Allan

This discussion has been closed.