File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes on clicking all hidden rows of table are displayed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "on clicking all hidden rows of table are displayed" Watch "on clicking all hidden rows of table are displayed" New topic
Author

on clicking all hidden rows of table are displayed

rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
Hi everybody

I want to have an html page where in if i click on say "+", the "+" becomes "-" and all the hidden rows are dispalye and if i click on "-" the rows are hidden back. how can we do that??
Can anybody please help me.

Thanks and Regards
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 815
AJAX can do that for you. Give your table an ID and in a javascript grab the table object and loop through the children (i.e. rows) and make them visible or hidden as you go through them. If you have more specific requirements (i.e. start at certain row clicked on) you might want to check out (google) rowIndex. I'm sure you'll get other responses in here that are more efficient but that's how I would do it if I had to right now. Hope it helps.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60816
    
  65

Ajax really isn't necessary. It's really just a matter of using the display CSS property appropriately.

Ajax would only be necessary if one wishes to delay the fetching of the hidden data until it is required. In that case, Ajax is indispensable.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: on clicking all hidden rows of table are displayed
 
Similar Threads
how to read html table in servlet
Disable hyperlink and Mouseover
jdbc 3 problem with buttons
Comparing Table Changes in a Web Application
JSF: Need advice on acheiving specific funcationality