aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Dynamically Scrolling to the newly added row in HTML table. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Dynamically Scrolling to the newly added row in HTML table." Watch "Dynamically Scrolling to the newly added row in HTML table." New topic
Author

Dynamically Scrolling to the newly added row in HTML table.

Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
Hi all,

I have a table in Iframe, I am adding the rows in the table dynamically.
I want the newly added row to be Visible/(to be scrolled) in the page.

If anyone knows this ? I tried the scrollIntoView() method of Ie but its not working..

Any Ideas??

Thanks in advance.


SCJP 1.2
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
In this table row is there any form elements? If there is there is a simple solution of calling a form element and setting its focus.

Eric
Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
Hi Eric,

Thanks for the reply but the focus won't scroll in the table rows and display the newly created row which I have added dynamically.
I tried to ficus that row by assigning one Id to the slement in the row but it did't worked.

Do you have some other idea.

thanks.
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi Anurag...

May be this answers your question....

I have an application wherei generate rows dynamically, using the "inerHTML" option. I generate som number of rows into a div. Once the row count is more than three, i am setting a scrollbar, in that particular portion of the HTML page.

Is this what you mean by "to be scrolled"?

Cheers,
Swamy
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Swamy, that is not what is happening here..


Try playing with this code that I just wrote...



Eric
Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
Hi Eric and Swamy thanks a lot for your reply I will work with your suggestions.

thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically Scrolling to the newly added row in HTML table.
 
Similar Threads
JS inside innerHtml
refreshing a JTable
Cursor positon within JTable
select a row in table
DOM and adding a brand new select list