Social Icons

.

วันพุธที่ 2 เมษายน พ.ศ. 2557

yii cgridview image size | Yii View

<?php
$this->widget('bootstrap.widgets.TbGridView', array(
    'type' => 'striped bordered condensed',
    'itemsCssClass' => 'table table-striped table-bordered table-condensed',
    'id' => 'search-grid', // id ของตาราง CGridView
    'dataProvider' => $tmpOrderList, // ข้อมูล dataProvider จากภายใน Model ของ function search()
    'template' => "{items}",
    'columns' => array(
        array(
            'header' => 'No.',
            'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1', //  row is zero based
        ),
        array(
            'name' => 'pictures',
            'type' => 'html',
            'value' => '(!empty($data->PICTURES))?CHtml::image("./images/Purchase/".$data->PICTURES,"",array("style"=>"width:180px;")):"no image"',
        ),
        'PRODUCT_CODE',
        'REF_CODE',
        'DESING',
        'COLOR',
        'SIZE_S',
        'SIZE_M',
        'SIZE_XL',
        'SIZE_F',
        'ORDER_QTY',
        'UNIT_PRICE',
        array(
            'name' => 'UNIT_PRICE',
            'value' => 'Yii::app()->numberFormatter->formatCurrency($data->UNIT_PRICE, "THB")',
        ),
        array(
            'name' => 'TOTAL_PRICE',
            'value' => 'Yii::app()->numberFormatter->formatCurrency($data->TOTAL_PRICE, "THB")',
        ),
        array(
            'class' => 'bootstrap.widgets.TbButtonColumn',
            'template' => ' {edit} {delete}',
            'buttons' => array
                (
                'edit' => array
                    (
                    'label' => 'Edit',
                    'icon' => 'pencil white',
                    'url' => 'Yii::app()->createUrl("Product/AddProduct", array("prdID"=>$data->ID))',
                    'options' => array(
                        'class' => 'btn btn-small btn-success',
                    ),
                ),
                'delete' => array
                    (
                    'label' => 'Del',
                    'icon' => 'icon-trash white',
                    'url' => 'Yii::app()->createUrl("Product/delProduct", array("prdID"=>$data->ID))',
                    'options' => array(
                        'class' => 'btn btn-small btn-danger',
                    ),
                ),
            ),
            'htmlOptions' => array(
                'style' => 'width: 80px',
            ),
        )
    ),
));
?>
 
Blogger Templates