แสดงบทความที่มีป้ายกำกับ Yii แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Yii แสดงบทความทั้งหมด

15 ก.พ. 2558

DropDownlist (onChange) Show & Hide Control

การเลือก Dropdownlist และกำหนดให้แสดง Control ตัวอื่นๆ ตามค่าของ Dropdown ที่เราเลือก

ในส่วนของ ฟอร์ม
 


ในส่วนที่จะซ่อนหรือแสดงข้อมูล




ในส่วนของ Javascript

function description(id)
{
      if(id==0)
      document.getElementById("description_id").style.display="block";
}

29 มิ.ย. 2557

CGridView : Get the absolute row number in a grid

code ในส่วนของ Cgridview

        array(
            'header'=>'No.',
        'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
    ),





อ้างอิง  http://stackoverflow.com/questions/5834522/get-the-absolute-row-number-in-a-grid

แสดง popup window ใน cGridview (bootstrap : TbGridView)

Code ในส่วของ girdview


28 มิ.ย. 2557

Twitter's Bootstrap - create a form with 2 columns

Twitter's Bootstrap - create a form with 2 columns




Legend text

Supporting help text

Legend text

Supporting help text

อ้างอิง http://www.way2blogging.org/2010/07/display-scripts-and-css-codes-between_09.html

30 พ.ค. 2557

การหาผลรวมของ Column ใน CGridView

การหาผลรวมของ Column ใน CGridView



public function getSearchCriteria()
{
    $criteria=new CDbCriteria;

    $criteria->compare('id',$this->id);
    $criteria->compare('name',$this->name);
    // ... more search conditions

    return $criteria;
}

public function search()
{
    return new CActiveDataProvider(get_class($this), array(
        'criteria'=>$this->getSearchCriteria(),
    ));
}

public function totals()
{
    $criteria=$this->getSearchCriteria();
    $criteria->select='SUM(somecolumn)';
    return $this->commandBuilder->createFindCommand($this->getTableSchema(),$criteria)->queryScalar();
}



6 ต.ค. 2556

การ Submit form ของ yii

ทำฟอรฺ์มมา submit แล้ว ฟอร์มมันไม่ submit สักที หานานมากว่าติด bug ตรงไหน ลองอยู่หลายวิธี ปราฏกว่าได้แล้ว
Db หน้าตาแบบนี้

1 ต.ค. 2556

Just another blog for sharing code: Make Different Cells css row or cells column in CG...

Just another blog for sharing code: Make Different Cells css row or cells column in CG...: CGridview is one of the most powerful tools that you can do with generating table in Yii framework.But sometimes you want to include your ow...

Just another blog for sharing code: Make ajax validation true in your captcha in yiifr...

Just another blog for sharing code: Make ajax validation true in your captcha in yiifr...: Maybe you want to use your captcha in your yiiframwork to use in ajaxvalidation to be true. By default the setting may use you as ajaxvalida...

Yii Framework Forum: Multi-language site in yii framework

Yii Framework Forum: Multi-language site in yii framework: To make multi language in your yii framework you have to implements some rules. You can use the session variables to make the translation ...

Yii Framework Forum: Yii – adding JavaScript into your views using Cont...

Yii Framework Forum: Yii – adding JavaScript into your views using Cont...: We can use Yii’s CClientScript for add javascript. //in your view where you want to include JavaScripts   Add following line of code in...

เป็นบทความดี ขอเก็บรวบรวมไว้มาอ่านทีหลังนะครับ