Index of column / row being edited.

Index of column / row being edited.

Karl53Karl53 Posts: 72Questions: 29Answers: 0

Given this:

                    // Find the cell that is currently being edited
                    var cell = $('div.DTE').parent();

How do I get the index of the column being edited?

I see column().index() but column() requires a selector.

What I want is the column of the cell the user is editing so I can pass it to JQuery's eq() method so if the user types the down arrow, the code can select the cell immediately below the cell the user is editing.

Replies

  • allanallan Posts: 61,759Questions: 1Answers: 10,111 Site admin

    You could use:

    table.column( $('div.DTE').closest('td') ).index();
    

    or since you already have the cell use that as the selector:

    table.column( cell ).index();
    

    Allan

This discussion has been closed.