473,394 Members | 1,869 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,394 software developers and data experts.

Hiding multiple rows in a dynamic table

I have a set of data that I display in a table. Each row has a category
and there may be a dozen or more rows in the same category. I'm looking
to add filter buttons to the page to hide/show categories on the fly.

Currently I can: Set the id on the tr to (category name) or to (category
name.data id).

Using the first, is there a way to hide all rows with that same id? It
seems currently to only hide the first row with that id.

If not, is there an easy way to find all rows whose id starts with
(category name)? I figure I could regex over every element in the page
looking for ones that begin with a particular id, but that would be
silly.

Also, is there a way to refer to every row of a table? I'd like to first
hide every row, then show those in the required category.

--
Change the *eye* in my email to the letter 'i'.
Jul 20 '05 #1
1 8971


Rick Measham wrote:
I have a set of data that I display in a table. Each row has a category
and there may be a dozen or more rows in the same category. I'm looking
to add filter buttons to the page to hide/show categories on the fly.

Currently I can: Set the id on the tr to (category name) or to (category
name.data id).

Using the first, is there a way to hide all rows with that same id? It
seems currently to only hide the first row with that id.

If not, is there an easy way to find all rows whose id starts with
(category name)? I figure I could regex over every element in the page
looking for ones that begin with a particular id, but that would be
silly.

Also, is there a way to refer to every row of a table? I'd like to first
hide every row, then show those in the required category.


If you have
<table id="tableId"
you can access the rows collection of the table element object:
var table;
if (document.all)
table = document.all['tableId'];
else if (document.getElementById)
table = document.getElementById('tableId');
if (table) {
//access table.rows
}
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

8
by: F. Da Costa | last post by:
Following is a snippet of html in which I hide a whole table and try to hide a single row. Here is my question (plz don't chew my head off if its css related instead): Why does the divTable...
3
by: gregory.sharrow | last post by:
I need to secure a datawarehouse table at the row level based on 1 to many keys on that table. A user should only see the rows they have access to. I need to be able to figure out which rows they...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
20
by: p175 | last post by:
Hi people, I have a stored procedure that creates many Global temporary session tables. Into each of these tables go the results of various processing using relational division all keyed and...
1
by: Fix_Metal | last post by:
Hello all. I'm new to this group :) I have a problem with javascript language. I'm making an .asp page with some integrated Javascript functions. The page consists of some HTML selects and a...
0
by: acarrazco | last post by:
Hello, I am totaly new to VBA and I'm trying to modify a macro that was given to me but it doesn't seem to be working. I'm trying to extract data from three excel spreadsheets, put it into a combined...
92
by: bonneylake | last post by:
Hey Everyone, Well i was hoping someone could explain the best way i could go about this. i have a few ideas on how i could go about this but i am just not sure if it would work. Right now i...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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:
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.