Setting Row of Table in viewport

M

Mel Smith

Hi:

How does one set the row of a long table (> 600 rows) to be visible in
the viewport.

btw, I have complete control of the table itself and can alter its
contents just prior to sending it out via my Apache server.

Thank you.

Mel Smith
 
J

Jukka K. Korpela

Mel said:
How does one set the row of a long table (> 600 rows) to be
visible in the viewport.

btw, I have complete control of the table itself and can alter its
contents just prior to sending it out via my Apache server.

So why don't you simply make it send that one row (a one-row table)?
 
M

Mel Smith

Jukka K. Korpela said:
So why don't you simply make it send that one row (a one-row table)?

Jukka:

This document is an online telephone book for the 613 residents of our
Senior Park.

The user has an option to 'Edit' his phone information. When he 'clicks'
on the Edit Button in his <tr><td> element, I present another page where I
input all his changes. On submission, I then change the phone database, and
then wish to re-send the complete 613-row updated telephone directory to him
to show these changes -- *but* with focus on *his* row of the directory (so
he doesn't have to page down and find his name again).

Thank you.

-Mel Smith
 
H

Harlan Messinger

Mel said:
Jukka:

This document is an online telephone book for the 613 residents of our
Senior Park.

The user has an option to 'Edit' his phone information. When he 'clicks'
on the Edit Button in his <tr><td> element, I present another page where I
input all his changes. On submission, I then change the phone database, and
then wish to re-send the complete 613-row updated telephone directory to him
to show these changes -- *but* with focus on *his* row of the directory (so
he doesn't have to page down and find his name again).

Now I can see how the sentence in your original post means that, but it
wasn't at all clear to me that that's what you meant.

The answer:

<tr><td>A row</td><td>...</td></tr>
<tr><td>Another row</td><td>...</td></tr>
<tr><td>Another row</td><td>...</td></tr>
<tr><td id="therow">THE row</td><td>...</td></tr>

If the URL for the page is blah, use blah#therow instead.
 
J

Jukka K. Korpela

Mel said:
This document is an online telephone book for the 613 residents of
our Senior Park.

Telephone books don't make good web pages. It's better to create a user
interface (form) for querying data in a telephone catalog, returning just
the entries that match the query.
The user has an option to 'Edit' his phone information. When he
'clicks' on the Edit Button in his <tr><td> element, I present
another page where I input all his changes.

That's a clumsy user interface.
On submission, I then
change the phone database, and then wish to re-send the complete
613-row updated telephone directory to him to show these changes --

Sounds weird. It's hardly efficient, but that's not the main point. The
point is that one should be able to edit one's own data without even seeing
other people's data.
*but* with focus on *his* row of the directory (so he doesn't have to
page down and find his name again).

Well, that's something different from showing (only) the particular row in
the viewport, isn't it?

Is this really about _focus_? Anyway the answer is that you cannot set focus
in HTML, and you could set it in JavaScript, with the usual caveats, but
most browsers let you set focus on some elements only, such as form fields
and links.

Moreover, there is no guarantee that the focused element is shown in the
viewport.

The best shot might be to put a link (possibly a dummy link) in a cell of
the row and focus on the link, e.g.

<tr><td><a href="#my" id="my">foobar</a><td> ...

with

<script type="text/javascript">
document.getElementById('my').focus();
</script>

and optionally with a stylesheet that tries to prevent the link from looking
like a link... doing just the opposite of good link design, that is. :)
 
M

Mel Smith

Jukka & Harlan:

Thanks for both your responses. I'll puzzle on them both, and then do
something about the problem

-Mel Smith
 
R

richard

Hi:

How does one set the row of a long table (> 600 rows) to be visible in
the viewport.

btw, I have complete control of the table itself and can alter its
contents just prior to sending it out via my Apache server.

Thank you.

Mel Smith

You might want to consider doing this in PHP. A server side script
could handle this problem easier.

Instead of listing all 600 plus items, list them in smaller groups.
Assuming you have somewhat of "streets" in your park, you could list
the names according to the street.
 
M

Mel Smith

richard said:
On Thu, 4 Jun 2009 12:35:12 -0600, "Mel Smith"
You might want to consider doing this in PHP. A server side script
could handle this problem easier.

Instead of listing all 600 plus items, list them in smaller groups.
Assuming you have somewhat of "streets" in your park, you could list
the names according to the street.

Richard:

Some explanatory notes and corrections:

- My phonebook is two columns (in the general sense) wide, with the
Names (plus phone numbers, addresses, lot numbers, etc, etc). in
alphabetical order left-to-right, and top-to-bottom.

- In the viewport in full-screen, nearly six phone/name entries are
displayed (with a slider on the right side of the viewport for a resident to
view all the other residents), and also a button (in his *own* entry) to
allow him to edit his own demographic information (some of which does not
display in the online phone book)

- Since we have a set amount of 613 homesites and homes, I then have
307 'blocks' of resident information arranged in two columns.

- Since I am a long-time commercial business application developer in
Windows, and have expertise in database systems (CDX Databases mostly), I
create / modify / send all my pages from a C-based language (see
www.xharbour.com). I run my own apache server right beside me in my home
office. I have a very limited knowledge of web page design going back only
five months

- Since I'm networked with my apache server beside me, it is normal
for me to send updates to the server many times each day for testing and
trials.

My Problem:

- The residential data is badly out-of-date (e.g.,home summer
caretakers have been dead for years, emergency phone numbers are badly
out-of-date, etc). The Park Office puts out a hard copy of the Phone Book
yearly, but it has wrong information in many places. Only the homeowner
himself *really* knows the correct information.

- I wish the homeowner (or one of his computer knowledgeable friends)
to access the online directory, move to his entry in the table, 'click' on
this EDIT button, get my input page, and modify his demographic data, submit
it to me, where I'll verify it (with my C-based CGI program), and place it
in my datasbase, and quickly re-build the basic resident directory page
(about 3/4 of a second).

- THEN, I want to send the corrected phonebook page back to him *and*
position the long table so that *his* entry is in the viewport, and he can
see that he made the proper changes.

(btw, this morning I tried to use the following:

<body onload="window.document.getElementById('lot318').focus();">

(and deep in the body I had <input type="submit", id="lot318",
value="EDIT> , etc, etc)

but when I viewed the page with explorer it didn't move down the
viewport to this entry. Sigh ...

Sorry for this long harangue.

Thanks for your suggestion.

-Mel Smith
 
M

Mel Smith

Richard:

I tried to send you a .png image of the phone directory viewport, but
your email bounced.

-Mel Smith
 
R

richard

Richard:

I tried to send you a .png image of the phone directory viewport, but
your email bounced.

-Mel Smith


Which is precisely why I use that addy.
Even though it is not mine and valid, I have permisson to use it.
I generally do not post my real addy to usenet.

But don't really be looking to me for your solution as I am not all
that much of a web designer or builder. I'm just an average tinkerer.

You should look into using php or perhaps even looking at a cgi
script. As I said, I would cut down the size of how many names are
displayed, then just link to the other pages.
 
R

richard

Richard:

I tried to send you a .png image of the phone directory viewport, but
your email bounced.

-Mel Smith

One other thing you might do is to post the url so I and others can
take a look and better help understand your problem.

As you have the server close at hand, you might want to take a look at
www.runbasic.com
This is a fairly simple programming language based on "Liberty Basic"
which has been designed primarily for use on home based systems, but
can be installed on full servers. It is kind of a mix between php and
the old "BASIC" language but upgraded for use in web development.

With your problem, you could easily write a small program that would
allow users to update information without to many hassles.

I have runbasic installed on my web server.
http://www.1littleworld.net/truck1.html
A simple program I wrote.
 
M

Mel Smith

One other thing you might do is to post the url so I and others can
take a look and better help understand your problem.

As you have the server close at hand, you might want to take a look at
www.runbasic.com
This is a fairly simple programming language based on "Liberty Basic"
which has been designed primarily for use on home based systems, but
can be installed on full servers. It is kind of a mix between php and
the old "BASIC" language but upgraded for use in web development.

With your problem, you could easily write a small program that would
allow users to update information without to many hassles.

I have runbasic installed on my web server.
http://www.1littleworld.net/truck1.html
A simple program I wrote.

Richard:

As I mentioned on a previous post, I have expertise (19 years) in
programming business apps. The package I use (www.xharbour.com) is more
powerful than a train and faster than a speeding bullet :)) So, I'll
continue using the Extended Harbour language (xHarbour)

Since I use xHarbour every day, and build apps big and small veery
often, I'll continue to use this language to continue building my CGI app.

btw,

Another helpful person in another ng suggested the following (which I'll
try this afternoon)

var
row=document.getElementById('tableid'):rows[rowIndex].scrollIntoView(true);

Thanks for the further comments

-Mel Smith
 
M

Mel Smith

Hi: Jukka, Martin & Richard:

My last post resulted in my solving the problem:


Here is the solution:

<body
onload="document.getElementById('myLotNumberEditButton').scrollIntoView();">

When this statement is placed in my Phone BookPage, the Viewport immediately
displays the required 'block' of resident information.

Thank you all for helping !

-Mel Smith
 
R

richard

Hi: Jukka, Martin & Richard:

My last post resulted in my solving the problem:


Here is the solution:

<body
onload="document.getElementById('myLotNumberEditButton').scrollIntoView();">

When this statement is placed in my Phone BookPage, the Viewport immediately
displays the required 'block' of resident information.

Thank you all for helping !

-Mel Smith

You might want to check that on various browsers for accuracy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top