Yii Framework Forum: How Filter Setup With Tbjsongridview? - Yii Framework Forum

Jump to content

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

How Filter Setup With Tbjsongridview? Rate Topic: -----

#1 User is offline   marvix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 127
  • Joined: 02-August 13

Posted 25 August 2014 - 05:37 PM

Hi,

Anyone can please help with this ..

// _grid.php

$this->widget('bootstrap.widgets.TbJsonGridView', array(
	'id'=>'rss-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	//bootstrap
	'type' => 'striped bordered condensed',
	'responsiveTable' => true,
	'json' => true,
	'enableSorting'=>true,
	'ajaxUpdate'=>true,
	'cacheTTL' => 10, // cache will be stored 10 seconds (see cacheTTLType)
	'cacheTTLType' => 's', // type can be of seconds, minutes or hours
	
	'summaryText' => false,
	'columns'=>array(
		array(
			'header'=>'ID',
			'name'=>'id',	
			'htmlOptions'=>array('width'=>'20'),
			'headerHtmlOptions'=>array('width'=>'20'),
		),
		'RssName',
		array(
		             'name'=>'Category', 
		             'value'=>'$data->Cat->name',
		             'filter' => CHtml::listData(Category::model()->findAll(), 'id','name'),
		             ),
		'RssLogo',
		array(
			'header' => 'Edit',
			'class' => 'bootstrap.widgets.TbJsonButtonColumn',
			'template' => '{view} {update} {delete}',
                'buttons' => array(
                    'delete' => array(
                        'click' => 'function(){return false;}'
                    )
                )
		),
	),
)); ?>


// model controller

	public function actionAdmin()
	{
		$model=new Rss('search');
		$model->unsetAttributes();  // clear any default values
		if (Yii::app()->getRequest()->getIsAjaxRequest()) {
     		header( 'Content-type: application/json' );
     		$this->renderPartial('_grid', compact('model'));
     		Yii::app()->end();
     		}

		if(isset($_GET['Rss'])) $model->attributes=$_GET['Rss'];

		$this->render('admin',array('model'=>$model,));
	}



the admin view has the form also, now changing the 'Category' result js error, how to achive this ?


THX.
0

#2 User is offline   marvix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 127
  • Joined: 02-August 13

Posted 26 August 2014 - 12:40 PM

Come on .. no one used filter with TbJsonGridView ?!
0

#3 User is offline   marvix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 127
  • Joined: 02-August 13

Posted 30 August 2014 - 09:24 AM

silence of the lambs ... :rolleyes:
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