• Post Reply Bookmark Topic Watch Topic
  • New Topic

Toggling of a table

 
Revanth reddy
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys.. I struck at some point of developement. Here is the scenario.

I am getting some values from DB based on user input and displaying on the table format in JSP.
now my requirement is there should be "+" symbol beside every row.. when the user clicks on "+" sign it should expand the grid and should display another table(with in the current table) data by accepting the some value in the first table as input(Basically it should exucute another query by taking the value where the user clicks on "+"), in the current table;

Any help would greatly appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you could either post back to the server to get the extra info, and recreate the table with the extra info inserted. Or, you could just place all the extra data in the table in the first place, but hidden, and show it when required. Or, you could use Ajax to fetch the extra info and show it when the icon is clicked.
 
Revanth reddy
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No answers from any body.....hmmm
i think my questions is not clear enough.

let me explain again.

i have the table in jsp.as shown below.

id name tech
+ 133 exam java
+ 134 exam1 jsp
+ 135 exam2 struts


now when the user clicks on + one more row should be displayed in the same table (need to get the values from the database)
basically it should execute a query.

SELECT * FROM table where id = ?(? is the id on c=which user clicks on +)



output should be::::

id name tech
- 133 exam java
id data date flag
133 sample 11nov08 Y

+ 134 exam1 jsp
+ 135 exam2 struts

i am not sure how to achieve this in jsp, javascipt. we can use toggling, but i am not sure it can be worked with dynamic data.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kumar kosaraju:
No answers from any body.....hmmm

Guess I'm a nobody.

If you're looking for how to make this work, I've already answered you. If you're looking for code to get written for you, you may be in the wrong place.
[ November 11, 2008: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!