3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 550 Views |
-
How to reload a separate template via Ajax?

12 April 2011 at 1:18am
Hello! I have a template in Include folder, like this:
<div id="mytemplate">
<% control MyControl(5) %>
$Content
<% end_control %>
</div>How I can change dynamically the value of a parameter for MyControl (e.g. 5 to 10) and reload only this template without reload the site?
Such as: onClick="javascript:function(paramvalue);"
Thanks.
-
Re: How to reload a separate template via Ajax?

12 April 2011 at 1:59am Last edited: 12 April 2011 2:00am
well you could render your template independently with...
Controller...function MyAJAX() {
Session::set('MyControlcount',Convert::raw2xml($_POST['PostedValue]));
return $this->renderWith('IncludeTemplate');
}...
function MyControl() {
$iCount = Session::get('MyControlcount');
if (empty($iCount)) $iCount=5;//defualt
//do and return stuff
}template...
<div id="mytemplate">
<% control MyControl() %>
$Content
<% end_control %>
</div> -
Re: How to reload a separate template via Ajax?

12 April 2011 at 10:33pm Last edited: 12 April 2011 11:25pm
Thank you! Last question. How I can set $_POST['PostedValue'] via Ajax without receiving page?
-
Re: How to reload a separate template via Ajax?

12 April 2011 at 11:18pm Last edited: 12 April 2011 11:25pm
Solved! I Must have been use method GET ($_GET['PostedValue']).
| 550 Views | ||
|
Page:
1
|
Go to Top |


