fnGetPosition of bVisible:false cols

fnGetPosition of bVisible:false cols

skyskyskysky Posts: 2Questions: 0Answers: 0
edited December 2013 in General
Hi,

I would like to get the position of an element inside the datatables (id column), but this column isn't on the DOM since I'm hiding it to the user with bVisible: false property. The documentation states that fnGetPosition does:

"Get the array indexes of a particular cell from it's DOM element and column index including hidden columns."

But this is not working here with the hidden columns.

Thanks for your time.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Thing is, you can't pass in the node if it is hidden, since you won't have the node. Can you explain what you are trying to do and perhaps I can help (maybe!) :-)

    Allan
  • skyskyskysky Posts: 2Questions: 0Answers: 0
    Thanks for your fast reply! :-)

    I am trying to get data from a hidden column (hidden with bVisible:false). I can access the hidden data since fnGetData method returns everything (hidden or not hidden) so this is not an issue.

    The problem I have is that I also need to get the hidden column index with fnGetPosition, referencing it as a classname or a data attribute, but as you state, I don't have the node since isn't in the DOM when the column is set to hidden.

    I wrote a workaround, cloning the complete 'th' row of the table before Datatables init and searching inside this clone to get the desired index, but there should be a cleaner way to do this.

    Many thanks!
This discussion has been closed.