key-focus event: get row/col number?

key-focus event: get row/col number?

optoopto Posts: 5Questions: 2Answers: 0
edited June 2021 in KeyTable

maybe I am only stumbling over my debugger:
the event returns cell.
It looks like cell has a property 0 which is an array which somewhere in a deeper level has rowno and columnno?

I don't get it really out of there. So if I have the event, how do I know which cell/row/col-No it comes from?

My workaround is to write col/rowNo into the node (which I get in the event) as extra attributes, which works, but there must be a better way.

thanks,
Klaus

Answers

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948

    The key-focus event provides the cell parameter which is an API instance, meaning you can use the cell() chained API's like cell().index(). Look at the example in the docs for this statement:

    var rowData = datatable.row( cell.index().row ).data();
    

    It uses cell().index() to get the cell's index which contains the column and row. In particular you can use cell.index().row to get the row and cell.index().column to get the column.

    Kevin

  • optoopto Posts: 5Questions: 2Answers: 0

    ah .. thanks. I tried cell().row().index() which didn't do what I needed. So I was close, but still wrong.
    Will try this

    Klaus

Sign In or Register to comment.