473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Table stops receiving kbd input in mozilla

I made a table that shows 20 rows of a table at a time.
When the user presses down or up arrow, the table will scroll as necessary
filling new rows.

But I have a problem with the following code snippet:
while (tr.sectionRowIndex < this.scrollRowsVisible && this._DBCacheS >
0)
{ //Scroll Up
// this.tBody.removeChild(this._DBRowCache[this._DBCacheE].element);
this.tBody.deleteRow(-1);
this._DBCacheS--;
this._DBCacheE--;
this.tBody.insertBefore(this._DBRowCache[this._DBCacheS].element,
this._DBRowCache[this._DBCacheS + 1].element);
}
while (tr.sectionRowIndex > (this.tBody.rows.length -
this.scrollRowsVisible) && this._DBCacheE < this._DBRowCache.length - 1)
{ //Scroll down
// this.tBody.removeChild(this._DBRowCache[this._DBCacheS].element);
this.tBody.deleteRow(0);
this._DBCacheS++;
this._DBCacheE++;
this.tBody.appendChild(this._DBRowCache[this._DBCacheE].element);
}

tr = currently selected row
this.scrollRowsVisible = # rows to have visible from currently selected row
to table "edge". This means that when scrolling down, there will always be 4
additional rows displayed below the current one.
this._DBCacheS, this._DBCacheE - indexes to first and last visible element
in cache. All elements between these values are shown in table
this._DBRowCache.length - # elements in cache

CSS:
..mytable {
font: Icon;
border: 1px Solid ThreeDShadow;
color: rgb(255,255,255);
margin-left: auto;
margin-right: auto;
text-align: left;
-moz-user-select: none;
-moz-user-focus: normal;
-moz-user-input: enabled;
}

This snippet works like a charm in IE, but in Mozilla / Firefox, it will
always stop receiving kbd input after #rows_in_table -
this.scrollRowsVisible + 1 consecutive movements.
This is the only code that checks for this.scrollRowsVisible and the number
of successful movements is directly related to this variable. It does not
matter how many times the loops execute eg. I can start presing down arrow
at the top of the table and it will stop after 16 presses (just after it
scrolls for the first time). Alternatively I can use the mouse to select one
of the bottom rows and then continue moving down with kbd only to stop after
scrolling 16 times.
To restore kbd input, I have to click on the table with the mouse. There is
no "special" code in that event that would help me "unlock". Tried every
possible variation. But I did discover that removing this.tBody.deleteRow
stops this behaviour.

Does anybody have any idea why this is happening? Any help would be greatly
appreciated.

Jure
Jul 23 '05 #1
2 1668
Stupid me! Found out why:
The table stops receiving kbd input the moment I remove the row I clicked.
Obviously this row had the kbd input focus.

The question now would be: Does anybody know how to set focus to a table row
or table cell? focus() is not a method of those objects.

Thanks,
Jure
Jul 23 '05 #2
Just for the reference:
..mytable tr {
-moz-user-focus: ignore;
}
This solves the problem. If the row can't receive focus, then it leaves only
the whole table / tbody to receive it. Therefore deleting the row will not
result in lost focus.

"Jure Erznoznik" <ju**@jantar.si> wrote in message
news:Ie********************@news.siol.net...
I made a table that shows 20 rows of a table at a time.
When the user presses down or up arrow, the table will scroll as necessary
filling new rows.

But I have a problem with the following code snippet:
while (tr.sectionRowIndex < this.scrollRowsVisible && this._DBCacheS >
0)
{ //Scroll Up
// this.tBody.removeChild(this._DBRowCache[this._DBCacheE].element);
this.tBody.deleteRow(-1);
this._DBCacheS--;
this._DBCacheE--;
this.tBody.insertBefore(this._DBRowCache[this._DBCacheS].element,
this._DBRowCache[this._DBCacheS + 1].element);
}
while (tr.sectionRowIndex > (this.tBody.rows.length -
this.scrollRowsVisible) && this._DBCacheE < this._DBRowCache.length - 1)
{ //Scroll down
// this.tBody.removeChild(this._DBRowCache[this._DBCacheS].element);
this.tBody.deleteRow(0);
this._DBCacheS++;
this._DBCacheE++;
this.tBody.appendChild(this._DBRowCache[this._DBCacheE].element);
}

tr = currently selected row
this.scrollRowsVisible = # rows to have visible from currently selected
row to table "edge". This means that when scrolling down, there will
always be 4 additional rows displayed below the current one.
this._DBCacheS, this._DBCacheE - indexes to first and last visible element
in cache. All elements between these values are shown in table
this._DBRowCache.length - # elements in cache

CSS:
.mytable {
font: Icon;
border: 1px Solid ThreeDShadow;
color: rgb(255,255,255);
margin-left: auto;
margin-right: auto;
text-align: left;
-moz-user-select: none;
-moz-user-focus: normal;
-moz-user-input: enabled;
}

This snippet works like a charm in IE, but in Mozilla / Firefox, it will
always stop receiving kbd input after #rows_in_table -
this.scrollRowsVisible + 1 consecutive movements.
This is the only code that checks for this.scrollRowsVisible and the
number of successful movements is directly related to this variable. It
does not matter how many times the loops execute eg. I can start presing
down arrow at the top of the table and it will stop after 16 presses (just
after it scrolls for the first time). Alternatively I can use the mouse to
select one of the bottom rows and then continue moving down with kbd only
to stop after scrolling 16 times.
To restore kbd input, I have to click on the table with the mouse. There
is no "special" code in that event that would help me "unlock". Tried
every possible variation. But I did discover that removing
this.tBody.deleteRow stops this behaviour.

Does anybody have any idea why this is happening? Any help would be
greatly appreciated.

Jure

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hanganum | last post by:
Hi, I am trying to build one HTML page with a table occupying the entire page and having two rows. The upper row contains data, while the lower row contains two buttons. My problem is: I want...
2
by: reinier | last post by:
If got a little problem, i've made a webpage that is working fine in IE, but in Mozilla i've got a little problem. When i go with my mouse over a input box or some kind of form object. The table...
0
by: javaguy | last post by:
I have a table I hide show/hide through a pair of divs. The show/hide part works fine in both Mozilla and MSIE. When switching between the hide and show versions the Mozilla browser keeps them in...
1
by: cotton_gear | last post by:
Hello, Fiest of all let me thank this group for so quick in responding to any postings. I am using a javascript based utility from a site to sort the columns of the table. But, for some strange...
6
by: Stefan Mueller | last post by:
The following code (HTML) generates a table. Now I'd like to insert a new row by a javascript. The following code (javascript) works with the Internet Explorer and also with Mozilla. However, the...
6
by: anirban.anirbanju | last post by:
hi there, i've some serious problem to add rows dynamically in a table. my table contains 5 cell. | check | from_value | to_value | color_text | color_value |...
6
shane3341436
by: shane3341436 | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
2
by: since | last post by:
How do I get IE and Mozilla to show the right border for an input tag. for the following table Everything looks great until I add the doctype tag. I can get IE to work by adding the following. ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.