Yii Framework Forum: Yii bootstrap "bootstrap.widgets.TbGridView" dont display pagination - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii bootstrap "bootstrap.widgets.TbGridView" dont display pagination Rate Topic: ***** 1 Votes

#1 User is offline   chaitsi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 21-November 11

Posted 29 August 2012 - 02:11 PM

I have installed yii bootstrap extension..
for grid view it dont display pagination...
which thing do i need to add
i wnat pagination similar to like in yii "zii.widgets.grid.CGridView"

it works for zii.widgets.grid.CGridView see code below ikn view file

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'message-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
                array(
                    'name'=>'nom',
                    'header'=>'Catégorie',
                    'type'=>'raw',
                    'value'=>'$data->nom',
                    'htmlOptions'=>array('width'=>'100'),
                    ),
                array(
                    'name'=>'adresse',
                    'value'=>'$data->adresse',
                    'htmlOptions'=>array('width'=>'40'),
                ),
                array(
                    'name'=>'gps',
                    'header'=>'Message',
                    'type'=>'raw',
                    'value'=>'$data->gps',
                    ),
		
		array(
			'class'=>'CButtonColumn',
		),
	),
));




but not for " bootstrap TbGridView "see code below in view file

$this->widget(
	'bootstrap.widgets.TbGridView', 
	array(
    'type'=>'striped bordered condensed',
    'dataProvider'=>$model->search(),
	'filter' => $model,
    'template'=>"{items}",
    'columns'=>array(
		
		array('name'=>'nom', 'header'=>'Identifiant'),
		array('name'=>'pays_id', 'header'=>'Nom'),
		array('name'=>'adresse', 'header'=>'Prenom'),
		array('name'=>'gps', 'header'=>'Niveau Utilisateur'),
		array('name'=>'app_type', 'header'=>'App type','filter'=>array(1=>"For Ferry",2=>"For avion"),'value'=>'Config::model()->getAppTypeTextName($data[app_type])'),
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'template'=>'{view}{update}{delete}',
			'buttons'=>array(	
				'update' => array(
				  'url'=>'Yii::app()->controller->createUrl("ports/update", array("id"=>$data[id]))',
				),
				'delete' => array(
				  'url'=>'Yii::app()->controller->createUrl("ports/delete", array("id"=>$data[id],"command"=>"delete"))',
				),
			),
		),	
    ),
));


plz if any one knows reply its urgent
0

#2 User is offline   chaitsi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 21-November 11

Posted 31 August 2012 - 07:19 AM

ohh..i got it

need to add
'dataProvider'=>$model->search(),
'filter'=>$model,
'template'=>"{items}\n{pager}",

View Postchaitsi, on 29 August 2012 - 02:11 PM, said:

I have installed yii bootstrap extension..
for grid view it dont display pagination...
which thing do i need to add
i wnat pagination similar to like in yii "zii.widgets.grid.CGridView"

it works for zii.widgets.grid.CGridView see code below ikn view file

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'message-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
                array(
                    'name'=>'nom',
                    'header'=>'Catégorie',
                    'type'=>'raw',
                    'value'=>'$data->nom',
                    'htmlOptions'=>array('width'=>'100'),
                    ),
                array(
                    'name'=>'adresse',
                    'value'=>'$data->adresse',
                    'htmlOptions'=>array('width'=>'40'),
                ),
                array(
                    'name'=>'gps',
                    'header'=>'Message',
                    'type'=>'raw',
                    'value'=>'$data->gps',
                    ),
		
		array(
			'class'=>'CButtonColumn',
		),
	),
));




but not for " bootstrap TbGridView "see code below in view file

$this->widget(
	'bootstrap.widgets.TbGridView', 
	array(
    'type'=>'striped bordered condensed',
    'dataProvider'=>$model->search(),
	'filter' => $model,
    'template'=>"{items}",
    'columns'=>array(
		
		array('name'=>'nom', 'header'=>'Identifiant'),
		array('name'=>'pays_id', 'header'=>'Nom'),
		array('name'=>'adresse', 'header'=>'Prenom'),
		array('name'=>'gps', 'header'=>'Niveau Utilisateur'),
		array('name'=>'app_type', 'header'=>'App type','filter'=>array(1=>"For Ferry",2=>"For avion"),'value'=>'Config::model()->getAppTypeTextName($data[app_type])'),
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'template'=>'{view}{update}{delete}',
			'buttons'=>array(	
				'update' => array(
				  'url'=>'Yii::app()->controller->createUrl("ports/update", array("id"=>$data[id]))',
				),
				'delete' => array(
				  'url'=>'Yii::app()->controller->createUrl("ports/delete", array("id"=>$data[id],"command"=>"delete"))',
				),
			),
		),	
    ),
));


plz if any one knows reply its urgent

2

#3 User is offline   Sukhwinder 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 27-October 09

Posted 19 January 2013 - 05:36 AM

View Postchaitsi, on 31 August 2012 - 07:19 AM, said:

ohh..i got it

need to add
'dataProvider'=>$model->search(),
'filter'=>$model,
'template'=>"{items}\n{pager}",


Thanks buddy, you saved me !
1

#4 User is offline   Goryny4 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 28-March 13

Posted 28 March 2013 - 03:19 AM

Thank you!!! O0
0

#5 User is offline   JohnnyQ 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 01-July 12

Posted 18 January 2014 - 05:15 AM

How do you set the page size? The number of items to be shown in each page?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users