การปรับแต่ง Toolbar Yiibooster – Ckeditorrow


<?php echo $form->ckEditorRow($model, 'description', array('options'=>array('fullpage'=>'js:true', 'width'=>'640', 'resize_maxWidth'=>'640','resize_minWidth'=>'320', 'toolbar'=>'js:[
                                                  ["Source","DocProps","-","PasteText","PasteFromWord"],
                                                  ["Undo","Redo","-","RemoveFormat"],
                                                  ["Bold","Italic","Underline","Strike","Subscript","Superscript"],
                                                  ["NumberedList","BulletedList","-","Outdent","Indent"],
                                                  ["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],
                                                  ["Link","Unlink"],
                                                  ["Image","Flash","Table","HorizontalRule","SpecialChar"],
                                                  ["Format","Font","FontSize","Styles"],
                                                  ["TextColor","BGColor"],
                                                  ["Maximize","ShowBlocks"]
                                                ],')));?>

Update/delete model with CJuiDialog (works in CGridView) เก็บไว้ก่อน

Update/delete model with CJuiDialog (works in CGridView)

http://2.delmo.ru/index.php?r=wiki/view&id=320

gridview view in modal popup Yii เก็บไว้ก่อน

In view

$this->widget(‘bootstrap.widgets.TbExtendedGridView’, array(
‘type’=>’bordered’,
‘dataProvider’=>$model->search(),
‘filter’=>$model,
‘template’=>”{items}”,
‘columns’=>array(
‘id’,
‘firstName’,
‘lastName’,
‘language’,
‘hours’,
array(
‘header’=>’Options’,
‘class’=>’bootstrap.widgets.TbButtonColumn’,
‘buttons’=>array(
‘view’=>
array(
‘url’=>’Yii::app()->createUrl(“person/view”, array(“id”=>$data->id))’,
‘options’=>array(
‘ajax’=>array(
‘type’=>’POST’,
‘url’=>”js:$(this).attr(‘href’)”,
‘success’=>’function(data) { $(“#viewModal .modal-body p”).html(data); $(“#viewModal”).modal(); }’
),
),
),
),
)
)));
?>

<!– View Popup  –>
<?php $this->beginWidget(‘bootstrap.widgets.TbModal’, array(‘id’=>’viewModal’)); ?>
<!– Popup Header –>
<div class=”modal-header”>
<h4>View Employee Details</h4>
</div>
<!– Popup Content –>
<div class=”modal-body”>
<p>Employee Details</p>
</div>
<!– Popup Footer –>
<div class=”modal-footer”>

<!– close button –>
<?php $this->widget(‘bootstrap.widgets.TbButton’, array(
‘label’=>’Close’,
‘url’=>’#’,
‘htmlOptions’=>array(‘data-dismiss’=>’modal’),
)); ?>
<!– close button ends–>
</div>
<?php $this->endWidget(); ?>
<!– View Popup ends –>

And in Controller 


public function actionView($id)
{
if( Yii::app()->request->isAjaxRequest )
{
$this->renderPartial(‘view’,array(
‘model’=>$this->loadModel($id),
), false, true);
}
else
{
$this->render(‘view’,array(
‘model’=>$this->loadModel($id),
));
}
}

การปรับแต่ง II CGridView pagination,summary,table positions

YII CGridView featured with 'template' option, which makes grid to easy customization.
  
//YII CGridView with top & bottom pagination with summary.

$this->widget('zii.widgets.grid.CGridView', array(
  'template' => "{pager}\n{summary}\n{items}\n{pager}",
);

//YII CGridView with top pagination with summary.

$this->widget('zii.widgets.grid.CGridView', array(
  'template' => "{pager}\n{summary}\n{items}",
);
//YII CGridView with top & bottom pagination without summary.

$this->widget('zii.widgets.grid.CGridView', array(
  'template' => "{pager}\n{summary}\n{items}\n{pager}",  
);

การใส่ Target Link ใน CGridView โดยใช้ Class CLinkColumn


'linkHtmlOptions'=>array('target'=>'_blank')
array( 'class'=>'CLinkColumn',
                        'header'=>'Print',
                        'linkHtmlOptions'=>array('target'=>'_blank')
 ),