473,398 Members | 2,343 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,398 software developers and data experts.

Highlighting Rows

To highlight the table's row with onmouseover/onmouseout events I use
2 functions which switch rows' class names. How can I highlight the
same rows, if every cell of the row contains various class names?

If cell has a CSS class name with some BG color, row's BG color is no
longer visible. I tried a function to loop through every cell of the
row and remove className onmouseover and apply back onmouseout. But
that generates error that className property is not found, even though
it is there. There are a lot of problems like that when I googled for
"error getting className property".

Is anyone aware of this situation and what to do? How to highlight row
with cells having different class names?
Thanks

Jul 16 '07 #1
3 2149
vu******@gmail.com wrote:
To highlight the table's row with onmouseover/onmouseout events I use
2 functions which switch rows' class names. How can I highlight the
same rows, if every cell of the row contains various class names?
Where one could suffice, I am sure.
If cell has a CSS class name with some BG color, row's BG color is no
longer visible. I tried a function to loop through every cell of the
row and remove className onmouseover and apply back onmouseout. But
that generates error that className property is not found, even though
it is there. There are a lot of problems like that when I googled for
"error getting className property".
Hrmm... you are resetting the className property instead of appending to
it? I don't see a problem.
Is anyone aware of this situation and what to do? How to highlight row
with cells having different class names?
Um, no. Search for jQuery and "zebra striping." 15DaysOfjQuery has a
great tutorial on this.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jul 16 '07 #2
On Jul 16, 2:43 pm, vunet...@gmail.com wrote:
To highlight the table's row with onmouseover/onmouseout events I use
2 functions which switch rows' class names. How can I highlight the
same rows, if every cell of the row contains various class names?

If cell has a CSS class name with some BG color, row's BG color is no
longer visible. I tried a function to loop through every cell of the
row and remove className onmouseover and apply back onmouseout. But
that generates error that className property is not found, even though
it is there. There are a lot of problems like that when I googled for
"error getting className property".
Can't help you there as you didn't post any code. But, if all of your
cell's have different colors, then perhaps you shouldn't obscure this
distinction in your rollover effect.

Jul 16 '07 #3
On Jul 16, 2:43 pm, vunet...@gmail.com wrote:
To highlight the table's row with onmouseover/onmouseout events I use
2 functions which switch rows' class names. How can I highlight the
same rows, if every cell of the row contains various class names?

If cell has a CSS class name with some BG color, row's BG color is no
longer visible. I tried a function to loop through every cell of the
row and remove className onmouseover and apply back onmouseout. But
that generates error that className property is not found, even though
it is there. There are a lot of problems like that when I googled for
"error getting className property".

Is anyone aware of this situation and what to do? How to highlight row
with cells having different class names?
Thanks
Not sure how you have your code setup but you can try this:

function highlightTableRow(tblTemp)
{//highlight table rows
var tr = tblTemp.getElementsByTagName('tr');
for(var j = 0; j < tr.length; j++)
{//only rows in <TBODYtags
if(tr[j].parentNode.nodeName == 'TBODY')
{
tr[j].onmouseover = function()
{
this.style.background = '#9cf';
return false;
}

tr[j].onmouseout = function()
{
this.style.background = '';
return false;
}
}
}
}

<table id="tblMyTable">
....
<tbody>
...//these rows get highlighted with mouseover event
</tbody>
</table>

<script language="javascript">
highlightTableRow(tblMyTable)
</script>

Jul 16 '07 #4

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

Similar topics

14
by: lance | last post by:
Hi, I am a JS newbie. Hopefully the answer to my question is not trivial. I have written a simple webpage that presents a table. A JS function allows the viewer to click on a cell and each...
3
by: Mark | last post by:
Hi there, I have a subform, set as a continuous form. When a user selects a particular record in that subform, how can I make that particular record stand out (color or font change, size, etc) from...
3
by: Matthew Kramer | last post by:
If I'm at row 10,000 of an Access table with 60,000 lines. Is there some way I could highlight all the rows from row 10,000 to the end of the table (row 60,000) in an easy way rather than having...
9
by: PeteCresswell | last post by:
I've got a continuous form that is a grid of statistical values. When the user clicks on a statistic, something happens (specifically a graph is created showing rolling one-year values for the...
4
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax...
2
by: ___Newbie___ | last post by:
Hello, I'm looking for a control that can display rows and columns similar to a table but highlight the entire row during selection? Listbox highlights the entire row but doesn't support...
0
by: mwhalber | last post by:
Hi, I am developing an application which highlights changes in streaming data (i.e. market changes.) I have developed this initially using the BackColor and ForeColor settings on the relevant...
4
by: lord.zoltar | last post by:
I am wondering how you guys highlight cells or rows (by changing the text or background colour) in a DataGridView. Right now, I apply styles to certain rows or cells in the CellFormatting even...
5
Breezwell
by: Breezwell | last post by:
I have done some searching on this one and I have yet to find any information that sheds light on what I am trying to do. At lease from what I can understand. Basically, I have a main form which...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.