|
|
|
สอบถามตัวแบ่งหน้า GridView ไม่แสดงปุ่มเปลี่ยนหน้า [ Yii ] |
|
|
|
|
|
|
|
จะ select ข้อมูลมาแสดงใน GridView โดยให้แสดงหน้าละ 5 แถว แต่ปุ่มที่จะให้คลิกเลื่อนไปยังหน้าถัดไปไม่แสดงขึ้นมาไม่รู้ว่าผิดจากตรงไหน
OpdControlle.php (PHP)
<?php
class OpdController extends Controller {
function actionIndex() {
$sql = "SELECT hn,name,idno FROM opddata where rdate between('2015/08/01') and ('2015/08/05') ORDER BY rdate ASC";
$dataProvider = new CSqlDataProvider($sql, array(
'pagination' => array(
'pageSize' => 5,
),
'keyField' => 'hn',
));
$this->render('OpdViews', array(
'dataProvider' => $dataProvider,
));
}
}
OpdModels.php (PHP)
<?php
class OpdModels extends CActiveRecord {
static function model($className = __CLASS__) {
return parent::model($className);
}
function tableName() {
return 'opddate';
}
static function getOpdList(){
$getModel = OpdModels::model()->findAll();
$arr = array();
foreach ($getModel as $r){
$arr[$r->hn] = $r->name;
}
return $arr;
}
}
OpdViews.php (PHP)
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'profile-gridview',
'dataProvider' => $dataProvider,
'enablePagination' => true,
'columns' => array(
array(
'header' => 'HN',
'name' => 'hn',
),
array(
'header' => 'NAME',
'name' => 'name',
),
array(
'header' => 'PID',
'name' => 'idno',
),
),
));
Tag : PHP
|
|
|
|
|
|
Date :
2015-09-29 10:42:19 |
By :
MooT |
View :
1172 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Concerning the display output issue, just see and focus on View.
|
|
|
|
|
Date :
2020-06-06 18:33:49 |
By :
PhrayaDev |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|