Answer the question
In order to leave comments, you need to log in
Why is Yii not generating javascript code for CActiveForm when sorting/paginating CListView?
There is a CListView whose elements are CActiveForm forms.
CListView:
$this->widget('zii.widgets.CListView', array(
'dataProvider' => $dataProvider,
'itemView' => '_view',
'afterAjaxUpdate' => 'someJsFunction'
));
$form = $this->beginWidget('CActiveForm', array(
'action' => array('update', 'id' => $model->productID),
'id' => 'product-form-' . $model->productID,
'enableAjaxValidation' => true,
'clientOptions' => array(
'validateOnType' => true,
'validateOnChange' => true,
'validationDelay' => 500
),
));
.....
$this->endWidget();
Answer the question
In order to leave comments, you need to log in
You either need to specify a callback in afterAjaxUpdate, where all binds will be hung up. Or use the so-called jQuery live binding.
This is due to the fact that when pagination is given content without js scripts inside, you can of course fool around in this direction, but for me personally, the path with binding turned out to be much easier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question