Focus on added row

Focus on added row

jotsysjotsys Posts: 5Questions: 0Answers: 0
edited October 2013 in General
Hi All,

I could not find an answer here. How can I set focus on the row I add to Datatables.

Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    As noted in the forum rules, please link to a test page showing the page you are working on with the issue, so we can see your code and suggest a solution. At the moment, I don't even know what kind of focus you want to use.

    Allan
  • jotsysjotsys Posts: 5Questions: 0Answers: 0
    Hello Allan,

    Sorry, I'm working on local server, that is why.

    I use oTable.fnAddData(['select form','select facility','select setting']);

    After this record is added to the datatables. I need to focus on it (at this time I have to click on the record to give it focus)

    Thx
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I still don't know what "focus" is here though. - a highlight? Class? User input focus? Please use js fiddle or similar to show us

    Allan
  • jotsysjotsys Posts: 5Questions: 0Answers: 0
    Sorry, I came from Delphi/C# background.

    When you click on a component , it gets focus. So when I click on a row in the datatables, it gets focus. Now , when I create a row by code, I like to give it focus 'as if I clicked on it'.

    Thx
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > When you click on a component , it gets focus. So when I click on a row in the datatables, it gets focus.

    Not in Javascript / browser. You would need to add a class to it, or in some other way indicate that it has focus. Not all elements in the browser can have focus, input form controls (there is probably some cunning CSS trick to allow elements to have focus as well, but I'm not sure off the top of my head what it is).

    Allan
This discussion has been closed.