Link to home
Start Free TrialLog in
Avatar of erikTsomik
erikTsomikFlag for United States of America

asked on

html table row comeback tabindex

I have a long list in the html table in the popup. each row a link to update the record. Once it is updated I need to refresh the popup and return to the row that I just edited.

Can anybody help me with a return option, I do not know how to do the focus on that row
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

ASKER

any suggestions
Avatar of Ioannis Paraskevopoulos
Hi, can you send a sample html? I need to see how the list is structured. For instance, do you use an id for each row?

Giannis
There are 5 or 6 ways to acquire and reference the handle of a table row, but without a link to the page I am not going to waste my time speculating about how you have coded the page.

Cd&
it is on my local machine . My table rows does not have id. So can you just point me to the right direction. Or give me just code sample
The table object has a rows collection as one of its properties  If you save the handle to the row where the event starts you should be able to focus back to it by referencing the row object in the handle.

I am not going to spend time trying to develop code in the dark.  If you post rendered code maybe someone will have time to look at it but not having a link makes it difficult to help you.

Cd&
here is my source code

<table class="tbl1 scroll">
            
            <tbody>
            
                  <tr>
                        <td>test</td>
                        <td>test</td>
                        <td>05/17/2013 05:06 PM</td>
                        <td>05/17/2013 05:05 PM</td>
                        <td>05/17/2013 05:05 PM</td>
                        <td><a onclick="showLoginHistory('5');return false;" href=""><b>+</b></a></td>
                  </tr>
            
                  <tr>
                        <td>test</td>
                        <td>test</td>
                        <td>05/17/2013 05:08 PM</td>
                        <td> </td>
                        <td>05/17/2013 05:08 PM</td>
                        <td><a onclick="showLoginHistory('57');return false;" href=""><b>+</b></a></td>
                  </tr>
            
                  <tr>
                        <td>test</td>
                        <td>test</td>
                        <td> </td>
                        <td> </td>
                        <td> </td>
                        <td><a onclick="showLoginHistory('199');return false;" href=""><b>+</b></a></td>
                  </tr>
            
                  <tr>
                        <td>test</td>
                        <td>test</td>
                        <td>04/15/2013 02:20 PM</td>
                        <td>03/25/2013 03:38 PM</td>
                        <td>08/16/2012 04:08 PM</td>
                        <td><a onclick="showLoginHistory('58');return false;" href=""><b>+</b></a></td>
                  </tr>
            
                  <tr>
                        <td>test</td>
                        <td>test</td>
                        <td>01/08/2013 03:33 PM</td>
                        <td>08/14/2012 01:58 PM</td>
                        <td>07/02/2012 02:26 PM</td>
                        <td><a onclick="showLoginHistory('51');return false;" href=""><b>+</b></a></td>
                  </tr>
            
                  
            
            </tbody>
      </table>
You have a hard value in the function call so just give each row an id of 'x' plus the number and you can access with document getElementById()


Cd&
I tried this

But it does not seems to work

$("tr").index('57');
ASKER CERTIFIED SOLUTION
Avatar of Ioannis Paraskevopoulos
Ioannis Paraskevopoulos
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial