Getting row and column index clicked?

Getting row and column index clicked?

RobWhisonantRobWhisonant Posts: 2Questions: 1Answers: 0
edited June 2014 in Free community support

I believe I have totally confused myself trying to do something simple?

I have a table. When a user clicks in a table cell I need to know what row and what column they clicked. How would this be done? I'm using version 1.1

Actually here is what I am needing to do.

Table has the first column hidden. When a user clicks on a cell I need to know what column they clicked on and the value in the hidden cell for the row clicked on.

Thanks for any help in advance.

Re's
Rob Whisonant

Answers

  • RobWhisonantRobWhisonant Posts: 2Questions: 1Answers: 0
    edited June 2014

    Here is what I have tried.

    This returns the data I need from the hidden column of the row clicked.

    $('#rotator_links_datatable tbody').on('click', 'tr', function () {
    var aData = oTable.fnGetData( this );
    var visIdx = $(this).index();
    });

    This returns the column index clicked.

    $('#rotator_links_datatable tbody').on('click', 'td', function () {
    var aData = oTable.fnGetData( this );
    var visIdx = $(this).index();
    });

    But I can't get it to work when I combine both.

This discussion has been closed.