Thanks a bunch Zaccaria!
I've been helped a great deal studying several of your posts and articles.
I don't get why some sort of fix hasn't been incorporated in the framework, but your fix makes it possible for me to use cJuiAutoComplete inside cJuiDialog!
ajax+clientScript Definitive solution for all clientScript problem in ajax request
#42
Posted 14 August 2011 - 08:27 AM
I don't know if it could help but for in my app, i've a customized layout/main.php. I inserted my specific jquery.js lib instead of using
So i double insert jquery. For some requests (such as several zii widgets), loader twice jquery resets some objet and generate a "$.param.querystring is not a function" js error client side.
Loading only once jquery fixed the issue for me.
Hope it could help
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery',CClientScript::POS_BEGIN);
So i double insert jquery. For some requests (such as several zii widgets), loader twice jquery resets some objet and generate a "$.param.querystring is not a function" js error client side.
Loading only once jquery fixed the issue for me.
Hope it could help
#43
Posted 26 August 2011 - 04:01 AM
We have made a custom way to handle a case that's somewhat related. It's tied up to jquery mobile, but should be easy to modify to a usual website. jQuery Mobile expects a returned page over ajax to be wrapped in a DIV, and any script outside this div is not usable for us, hence the wrapping. Basically, we never enable processOutput in any of our renders, and this method ensures that scripts are returned.
Usage in controller:
Implementation:
Usage in controller:
$widget = $this->renderPartial('widget',array(),true); // return contents, no processOutput
$this->renderPage('myview',array('items' => $items,'widget' => $widget),array('id' => 'my-page'));
Implementation:
public function renderPage($view,$params = array(),$options = array(), $return = false, $process = true){
if (!isset($options['id']))
{
$options['id'] = $this->id .'-'.$this->getAction()->id;
}
if (!isset($options['data-role']))
{
$options['data-role'] = 'page';
}
// page div wrapper for jquery mobile
$html = "<!-- page {$options['id']} -->\n";
$html .= CHtml::openTag('div',$options)."\n";
// only process if this is an ajax request
$html .= $this->renderPartial($view,$params,true,Yii::app()->request->isAjaxRequest);
$html .= CHtml::closeTag('div');
$html .= "\n<!-- // page {$options['id']} -->";
// if we do not have a ajax request, render with layout (will also process)
if (!Yii::app()->request->isAjaxRequest)
{
Yii::trace('running renderText');
$html = $this->renderText($html);
}
if ($return){
return $html;
}
else
{
echo $html;
}
}
#44
Posted 29 August 2011 - 03:12 AM
I liked the idea blux had on the second page, but doing special server-side work really didn't appeal to me. My solution is to attach to jQuerys filtering methods and do about the same magic there.
Check http://www.eirikhoem...-ajax-requests/ for more info and code.
Check http://www.eirikhoem...-ajax-requests/ for more info and code.
#45
Posted 08 December 2011 - 10:03 PM
Cool, got this working today....I've got a page that loads JS stuff via ajax and spent most of the day trying to figure out why it wasn't working.
Does anyone know if this has a bug # I can track or if it's going to be fixed in 1.1.9?
Thanks,
Matt
Does anyone know if this has a bug # I can track or if it's going to be fixed in 1.1.9?
Thanks,
Matt
#46
Posted 29 March 2012 - 04:56 AM
thank you very much zaccaria, using your script I could finally overcome the problem when I need to update the CTreeview.
#47
Posted 18 September 2012 - 03:24 PM
i have a gridview column with scripts.
i want to render script on ajax grid view. i think i can't use zaccaria solution because yii create renderpartial by it self.
we have any official patch for this or better solution? i searched forum many times and this is a usuall issue.
and is there any intention to fix this by Yii developers?
i want to render script on ajax grid view. i think i can't use zaccaria solution because yii create renderpartial by it self.
we have any official patch for this or better solution? i searched forum many times and this is a usuall issue.
and is there any intention to fix this by Yii developers?
#48
Posted 27 September 2012 - 06:39 AM
I have a question that I didn't get, but perhaps I'm missing something obvious:
Why should we create a ZController ?
Can't we simply use Controller for that propose avoiding creating yet another controller ?
Thanks
Why should we create a ZController ?
Can't we simply use Controller for that propose avoiding creating yet another controller ?
Thanks
#49
Posted 10 November 2012 - 06:22 AM
Thank you so much!
After searching for hours I finally came up with the idea that this problem should be some bug in Yii and then this tutorial/solution came up!
You made my day
After searching for hours I finally came up with the idea that this problem should be some bug in Yii and then this tutorial/solution came up!
You made my day
#50
Posted 19 February 2013 - 06:53 AM
Hi,
please change the the button id in unique it's solved.
not think more...it's run to me.
Best Regards,
Ankit Modi
please change the the button id in unique it's solved.
not think more...it's run to me.
Best Regards,
Ankit Modi

Help













