Hi @all,
I have a big issue since three days… maybe someone can provide me help.
I have a index.php with some jqueryui controls, ajaxsubmitbutton and a partial render page _result.php which renders a CListView. If I click on the button to request a partial render, the jquery ui controls are not working anymore.
any suggestions? It seems like jquery ui is not loaded.
if I add the RegisterScript of jquery and jquery ui to the partial render page, it seems that jquery is working again. but the controls are in an unknown state. and wont work properly again. but this time without a script error.
My main.php for the script includes:
<?php
Yii::app()->clientScript->registerCoreScript('jquery');
Yii::app()->clientScript->registerCoreScript('jquery.ui');
Yii::app()->clientScript->registerCssFile(Yii::app()->clientScript->getCoreScriptUrl().'/jui/css/base/jquery-ui.css');
?>
index.php with some code snippets for the jquery ui radiobuttons
<div id="gametypeRadio" class="rowRadioButtons clearfix" >
<?php
echo CHtml::radioButtonList('gametype_id', '', $modelGameType,
array( 'template'=>"{input}{label}", 'separator' => "",
'class' => 'gametyperadiobuttons',
));
?>
</div>
the js code self made for the radio buttons:
/*<![CDATA[*/
$(document).ready(function() {
$( "#gametypeRadio" ).buttonset();
$( "#holztypeRadio" ).buttonset();
$( "#playersPerTableRadio" ).buttonset();
$( "#limittypeRadio" ).buttonset();
});
jQuery(function($) {
// update holztype if gametype changes
jQuery('body').undelegate('.gametyperadiobuttons','click').delegate('.gametyperadiobuttons','click',function(){
// disable and uncheck other sub radio buttons if gametyp changes
$( "#gametypeRadio" ).buttonset();
$( "#holztypeRadio" ).buttonset();
$( "#playersPerTableRadio" ).buttonset();
$( "#limittypeRadio" ).buttonset();
jQuery('.playerspertableradiobuttons').button( "disable" );
jQuery('.limittyperadiobuttons').button( "disable" );
jQuery('.holztyperadiobuttons').button( "disable" );
$('.playerspertableradiobuttons').prop('checked', false);
$('.limittyperadiobuttons').prop('checked', false);
$('.holztyperadiobuttons').prop('checked', false);
jQuery('.playerspertableradiobuttons').button( "refresh" );
jQuery('.limittyperadiobuttons').button( "refresh" );
jQuery('.holztyperadiobuttons').button( "refresh" );
jQuery.ajax({
'type':'POST',
'url':'/holz/index.php/UserSkillConfig/dynamicholzTypesForRadioButtons',
'cache':false,
'data':jQuery(this).parents("form").serialize(),
'success':function(html){
jQuery("#holztypeRadio").html(html);
$( "#holztypeRadio" ).buttonset();
}
});
return false;
});
The partial render page _ajaxSearch.php
<?php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'enablePagination' => false,
'itemView'=>'_listview',
'id'=>'ajaxListView',
'ajaxUrl' => CController::createUrl('HolzCoach/dynamicSearchResult')
));
?>
Any Suggestion would be great!
Thanks!