Well there could be several solutions to what you wish to achieve.
I'll give you one quick one that I can think of right now.

create the div's with a particular class, say IP_click.

and then do

$('.IP_click').click(function(){
 $(this).children('.IP').toggle().ajax(function(){
  //call page here;
 });
});

*NOTE: in your example your using ID's, now technically you can't have OR
you aren't supposed to have multiple DOM elements with the same ID, even if
you do (by mistake or whatever) the $('#ID') would always return the first
DOM element with that ID.*

Now coming to the piece of code I wrote above, that will essentially help
you do what you want,
but taking this to the next level, I am assuming that for each of the div's
you might have some specific data that you will be posting to the server to
get the specific results back, for that you could again have several
solutions, one would be to simple have hidden fields with that data within
the div's.

Hope it helps, or you might have to be a little more specific perhaps.

Thanks & Regards,
Dhruva Sagar.


Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html>  -
"The trouble with a kitten is that when it grows up, it's always a cat."

On Fri, Aug 21, 2009 at 6:51 PM, Wrenbjor <wrenb...@gmail.com> wrote:

>
> I want to be a little more clear. I don't want someone to write this
> for me, I want to understand the process on how to do it. I think it
> will rely on chaining events, so I think I need a better understanding
> on how to make that work.
>
> On Aug 20, 4:34 pm, Wrenbjor <wrenb...@gmail.com> wrote:
> > ok I am using the table expanding code found herehttp://
> www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-wit...
> >
> > basicily it hides the even rows on the table and when you click a row
> > that is shown (a master row) the row under it slides into place. it
> > works great but it's built on the premeiss that the content in the
> > hidden rows is loaded on page load and just waiting to be displayed. I
> > am looking to make this dynamic and cant think how to do it.
> >
> > this is what I want: the main table will load with data in the master
> > rows. this will be something like a server IP or a FQDN. when the user
> > clicks on the master row the next TR under it will slide into place
> > and an ajax call will happen displaying server stats in the newly
> > shown TR. I dont want to load this data on page load because it might
> > be a list of 500+ servers. so I need it one at a time on TR click. So
> > my thought was to make one of the TD's in the master row contain a div
> > with an ID of IP_click and the hidden TR have a TD with a div that has
> > an ID of IP. so I would call
> >
> > $("#IP_click").click(function(){
> > $("#IP").toggle().ajax(function(){
> >  call page here;
> >
> > });
> > });
> >
> > Now I would love to write one function so that I dont have a JQ call
> > for each server $("#IP1_click) $("#IP2_click") etc... so I think I'm
> > close I just cant figure how to get the dynamic id's to the function
> > call. I am using PHP if that helps.

Reply via email to