I am trying to have an element on a page when clicked calls an ajax function to output a widget.
Problem: This ajax action is only outputting <div id="slider"></div>
Anyone have any idea what the issue is?
Here is the ajax call
var data = 'val1='+val1+'&val2='+val2;
$.ajax( {
type: 'POST',
url: '/mycontroller/ajaxCall',
data: data,
}).success(function(data) {
$('#widget-wrapper').html(data);
});
Here is the ajax action
public function actionAjaxCall() {
if (Yii::app()->request->isAjaxRequest) {
$this->widget('zii.widgets.jui.CJuiSlider', array(
'id' => 'slider',
'value' => 37,
'options'=>array(
'min'=>0,
'max'=>99,
),
)); // BUG ONLY OUTPUTS #slider div with no classes or value handle contents
} else {
$this->redirect('index');
}
}