yii-booster

Yii populate a dropdown on select of another

[亡魂溺海] 提交于 2019-12-13 05:07:41
问题 I have a dropdown that I want to populate when an item in another dropdown is selected. Both the dropdown are tied to data/model passed on from controller. and the first dropdown is populated from DB by calling a function in the model. Heres' the form, echo $form->dropDownListRow($modelunit, 'superunit', $model->getSunits(), array( 'ajax' => array( 'type'=>'POST', 'url'=>CController::createUrl('user/getunits'), 'update'=>'#unit_id', ))); echo CHtml::dropDownList('unit_id','', array()); Here's

Failure invoking a modal window through jquery in Yii

青春壹個敷衍的年華 提交于 2019-12-13 00:28:16
问题 I tried to add modal window to my yii app. For this I use jquery from the framework. Yet, It does not work with jquery (1.8.3) from the framework: framework/web/js/source The error is: Uncaught TypeError: Object [object Object] has no method 'modal' In this line: $('#dataModal').modal().css({ width: 'auto', height: 'auto', }); (see the full code below). The same happens when I exchange modal() to dialog(). Yet, when I try to upload the latest jquery (1.10.2) through googleapis by registering