Re: Updating Div with ajax

2007-08-20 Thread [EMAIL PROTECTED]



On Jul 30, 11:36 am, madmike210 [EMAIL PROTECTED] wrote:
 In a view, I would like to be able to click on a button and have the
 index displayed in a div.  I accomplish this by doing the following in
 a view:

 div onclick=new Ajax.Updater('main_div', '/admin/groups/
 index');GROUP VIEW/div
 span onclick=new Ajax.Updater(''main_div', '/admin/users/
 index');USER VIEW/div

 ? echo $ajax-div('main_div'); ?
 ? echo $ajax-divEnd('main_div'); ?

 However, the index.thtml is displayed in the div with the information
 generated by default.thtml.  In other words, index.thml is displayed
 the same as it would if I went directly to the address.  So, it looks
 like a page is displayed in my div.  How do I prevent this?  How would
 I only display the code that is in the specified index.thtml without
 the default.thtml it is wrapped in?

In your controller use:
$this-layout = ajax;


--
/David


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Updating Div with ajax

2007-07-30 Thread madmike210

In a view, I would like to be able to click on a button and have the
index displayed in a div.  I accomplish this by doing the following in
a view:

div onclick=new Ajax.Updater('main_div', '/admin/groups/
index');GROUP VIEW/div
span onclick=new Ajax.Updater(''main_div', '/admin/users/
index');USER VIEW/div

? echo $ajax-div('main_div'); ?
? echo $ajax-divEnd('main_div'); ?

However, the index.thtml is displayed in the div with the information
generated by default.thtml.  In other words, index.thml is displayed
the same as it would if I went directly to the address.  So, it looks
like a page is displayed in my div.  How do I prevent this?  How would
I only display the code that is in the specified index.thtml without
the default.thtml it is wrapped in?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating Div with ajax

2007-07-30 Thread John David Anderson (_psychic_)


On Jul 30, 2007, at 9:36 AM, madmike210 wrote:


 In a view, I would like to be able to click on a button and have the
 index displayed in a div.  I accomplish this by doing the following in
 a view:

 div onclick=new Ajax.Updater('main_div', '/admin/groups/
 index');GROUP VIEW/div
 span onclick=new Ajax.Updater(''main_div', '/admin/users/
 index');USER VIEW/div

 ? echo $ajax-div('main_div'); ?
 ? echo $ajax-divEnd('main_div'); ?

 However, the index.thtml is displayed in the div with the information
 generated by default.thtml.  In other words, index.thml is displayed
 the same as it would if I went directly to the address.  So, it looks
 like a page is displayed in my div.  How do I prevent this?  How would
 I only display the code that is in the specified index.thtml without
 the default.thtml it is wrapped in?

In your controller action:

$this-layout = 'ajax';

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating Div with ajax

2007-07-30 Thread francky06l

You can also integrate the component  'RequestHandler' in your
controller, that should handle the ajax layout automatically :-)

On Jul 30, 5:51 pm, John David Anderson (_psychic_)
[EMAIL PROTECTED] wrote:
 On Jul 30, 2007, at 9:36 AM, madmike210 wrote:





  In a view, I would like to be able to click on a button and have the
  index displayed in a div.  I accomplish this by doing the following in
  a view:

  div onclick=new Ajax.Updater('main_div', '/admin/groups/
  index');GROUP VIEW/div
  span onclick=new Ajax.Updater(''main_div', '/admin/users/
  index');USER VIEW/div

  ? echo $ajax-div('main_div'); ?
  ? echo $ajax-divEnd('main_div'); ?

  However, the index.thtml is displayed in the div with the information
  generated by default.thtml.  In other words, index.thml is displayed
  the same as it would if I went directly to the address.  So, it looks
  like a page is displayed in my div.  How do I prevent this?  How would
  I only display the code that is in the specified index.thtml without
  the default.thtml it is wrapped in?

 In your controller action:

 $this-layout = 'ajax';

 -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating Div with ajax

2007-07-30 Thread madmike210

Thanks for the help, and suggestions.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---