Showing 21-40 of 55 items.

CGridView: Adding behaviors from configuration, and template items from behaviors to CGridView

Created 13 years ago by le_top le_top, updated 13 years ago by le_top le_top. 0 comments

Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.

3 0
3
Viewed: 18 387 times
Version: 1.1
Category: Tips

Open Dialog from ajax content

Created 13 years ago by Touzas Touzas, updated 13 years ago by Touzas Touzas. 1 comment

This is the code in the View.

<?php echo CHtml::link('MyDialog', Yii::app()->createUrl('site/page'), array('class' => 'openDlg divDialog')); ?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id'=>'divDialog',
	'options'=>array( 'title'=>Yii::t('Dialog Title', 'autoOpen'=>false, 'modal'=>true, 'width'=>600)));
?>
	<div class="divForForm"></div>
<?php
$this->endWidget(...
3 1
5
Viewed: 26 786 times
Version: 1.1
Category: How-tos

CGridView, CListView and CActiveDataProvider

Created 13 years ago by softark softark, updated 13 years ago by softark softark. 22 comments

CGridView (or CListView) together with CActiveDataProvider is a very powerful combination of the built-in tools of Yii. But how do they work together to accomplish their fantastic functions? And what are you expected to do to use them and to customize their behaviors? This article explains the very basics of them.

26 0
33
Viewed: 151 705 times
Version: 1.1
Category: Tutorials

Dynamic parent and child CGridView on single view. Using $.ajax to update child gridview via controller, after row in parent gridview was clicked.

Created 14 years ago by Gerhard Liebenberg Gerhard Liebenberg, updated 12 years ago by Gerhard Liebenberg Gerhard Liebenberg. 20 comments

Many desktop programmers are used to having dynamic forms, where clicking on a record in a parent sub-form, updates another sub-form with the child records. While having many levels of nested sub-forms in a single view might not be such a good idea for a web application, I thought doing it one level deep might be interesting and useful. But, instead of sub-forms I used CGridViews.

Avoiding duplicate script download when using CActiveForm on Ajax calls

Created 14 years ago by Antonio Ramirez Antonio Ramirez, updated 14 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 2 comments

The only thing required is simple, we just need to create a view that will be partially rendered by a call to a controller (using renderPartial) and make sure that we process output -setting to true the parameter on the function. Everything will work as expected but...

11 1
9
Viewed: 30 608 times
Version: 1.1
Category: Tutorials