heading for the cgridview

Hi all,

I want to display the id of a reocrd outside the cgridview instead of inside the grid.

The following is my admin code:


<?php

$this->breadcrumbs=array(

	'Purchase Orders'=>array('index'),

	'Manage',

);


$this->menu=array(

	array('label'=>'List PurchaseOrder', 'url'=>array('index')),

	array('label'=>'Create PurchaseOrder', 'url'=>array('create')),

);


Yii::app()->clientScript->registerScript('search', "

$('.search-button').click(function(){

	$('.search-form').toggle();

	return false;

});

$('.search-form form').submit(function(){

	$.fn.yiiGridView.update('purchase-order-grid', {

		data: $(this).serialize()

	});

	return false;

});

");

?>





<?php // echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>

<div class="search-form" >

<?php $form=$this->beginWidget('CActiveForm')

//, array(

	//'action'=>Yii::app()->createUrl($this->route),

	//'method'=>'get',

//)); ?>


 <div class="row">

		<?php echo $form->labelEx($model,'po_num'); ?>

		<?php echo $form->dropDownList($model, 'po_num', CHtml::listData(PurchaseOrder::model()->findAll(), 'po_num', 'po_num'), array('prompt'=>'Select product...')); ?>

		<?php echo $form->error($model,'po_num'); ?>

	</div>

	

	<div class="row buttons">

		<?php echo CHtml::submitButton('Search'); ?>

        <?php //echo CHtml::submitButton('Search All'); ?>

        <? //	echo CHtml::button('Submit',array('onclick'=>'submit()'));?>

	</div>


<?php $this->endWidget(); ?>


</div><!-- search-form -->


<?php

 

 $this->widget('zii.widgets.grid.CGridView', array(


	'id'=>'purchase-order-grid',

	'dataProvider'=>$model->search(),

		'columns'=>array(

		'purchase_order_id',

		'po_num',   // i want this number outside the grid

		'supplier_id',

		'date',

		array(

			'class'=>'CButtonColumn',

		),

	),

)); ?>



i want the po_num to be displayed outside the grid. Is this possible? Any help would be really appreciated.

Thanks in advance

You have to pass the po_num as an parameter from the action to the view.




// model

public function actionHelloWorld()   

{

  $po_num = 123; // of cource you get your id from the database or from somewhere else

  $this->render('helloWorld', array('my_po_num' => $po_num));

}






// view

echo $my_po_num;



Have found a good tutorial ;)