aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Hiding group of rows depending on dropdown list 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 "Hiding group of rows depending on dropdown list" Watch "Hiding group of rows depending on dropdown list" New topic
Author

Hiding group of rows depending on dropdown list

manisha makwana
Ranch Hand

Joined: Sep 14, 2007
Posts: 37
Hi,

I am getting all the rows and column of a table in my page.And in dropdown list i am giving column name depending on cloumn name i have to show value of that column.
Can any one explani me how to do the same using Javascript
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Your question is not clear.

You want to hide table columns?

Eric
manisha makwana
Ranch Hand

Joined: Sep 14, 2007
Posts: 37
Hi Eric,

In a dropdown list i have all the column name say A,B,C,D.And in my resultset i have a row whose name is A,B,C,D.And in resultset i have this value for user X,Y,Z.if from drop down list user select B then i want to display row B for user X,Y,Z.I have to do this by hiding row depneding on criteria form dropdown list.
Can you please help me to do the same.
User X
======================================
A
B
C
D
====================================
User Y
A
B
C
D
Cloudgen C.F. Wong
Greenhorn

Joined: Jul 15, 2009
Posts: 19
I have written a similar example using jQuery. See if it fits your need.

Live demo: Demo for selection box matching table column


cheers
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can hide columns by using colgroup and setting the display to none for col.

Eric
Cloudgen C.F. Wong
Greenhorn

Joined: Jul 15, 2009
Posts: 19
Eric Pascarello wrote:You can hide columns by using colgroup and setting the display to none for col.

Eric


I tried using the colgroup for accessing the collaborative style properties. I find out it's not work for some web-browser (in my test, opera 10.0 beta) and not work for some style properties, too.

See, the test page for changing column's background color: my test page 1

The test page for changing column's "display" property: my test page 2

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hiding group of rows depending on dropdown list