Select default line

Select default line

gerennegerenne Posts: 30Questions: 0Answers: 0
edited May 2012 in General
Hi all,

I have a dataTable (DOM), when I open the app, I want that the firts line in the table appear selected by default, how is this possible?.

Thanks in advance.

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Sure it's possible. How are rows selected in your table? If its a click on the row just do something like $('mutable tbody tr:eq(0)').click().

    Allan
  • gerennegerenne Posts: 30Questions: 0Answers: 0
    Hi Allan , only one line.

    Thanks in advavnce.
  • gerennegerenne Posts: 30Questions: 0Answers: 0
    Hi again,

    If I want select another line?, but this line I don't know the row number, I only know the code, that this code to appear in the first column.

    Thanks in advance.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Then you would need to parse through the table, find it and click it, using the technique I suggest. fnGetNodes and fnGetData might be useful.

    Allan
This discussion has been closed.