Solved

html table row comeback tabindex

Posted on 2013-05-23
9
814 Views
Last Modified: 2013-06-23
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
0
Comment
Question by:erikTsomik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 19

Author Comment

by:erikTsomik
ID: 39192594
any suggestions
0
 
LVL 23

Expert Comment

by:Ioannis Paraskevopoulos
ID: 39193775
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
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39194652
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&
0
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
LVL 19

Author Comment

by:erikTsomik
ID: 39194762
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
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39194986
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&
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 39195016
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>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39195034
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&
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 39195224
I tried this

But it does not seems to work

$("tr").index('57');
0
 
LVL 23

Accepted Solution

by:
Ioannis Paraskevopoulos earned 500 total points
ID: 39195539
Hi,

If for your first row you have:

                  <tr id="Row1">
                        <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>

Open in new window


Then you can reference it as:
document.getElementById("Row1")

Open in new window


And if you wanted the anchor element then you would have:
document.getElementById("Row1").children(5).children(0)

Open in new window


Giannis
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question