• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

on clicking all hidden rows of table are displayed

 
rammie singh
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic