Yii Framework Forum: [ASK] gimana nambahin row customize table cgridview - Yii Framework Forum

Jump to content

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

[ASK] gimana nambahin row customize table cgridview Rate Topic: -----

#1 User is offline   karin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 13-April 12
  • Location:surabaya

Posted 13 April 2012 - 09:26 PM

maap ni agan2 semua ane masih newbie soal yii, ane mau nanya gimana caranya customize table cgridview...


view(gridview) begini...
$this->widget('zii.widgets.grid.CGridView', array(
		'id'=>'invoice-grid',
		'cssFile' => Yii::app()->baseUrl . '/css/printgridView/gridView.css',
		'dataProvider'=>$detail->searchDetail($modelMaster->invoice_id),
		
		'columns'=>array(
			array(
			 'name'=>'No',
			 'value'=>'$row+1',
			),
			'site_id',
			array(
			 'name'=>'site',								     value'=>'CHtml::encode(@$data->site_name)',										
			),
			array(
			 'name'=>'service_number',
      			'value'=>'CHtml::encode(@$data->material_service_number)',
			'htmlOptions'=>array('style'=>'text-align:center'),
			),
			array(
			'name'=>'material_service_description',
			'value'=>'CHtml::encode(@$data->material_service_description)', 
			),
			'po_number',
			array(
			'name'=>'grses_number',
			'value'=>'CHtml::encode(@$data->grses_number)',
			'htmlOptions'=>array('style'=>'text-align:center'),
			'footer'=>'Subtotal',
			),
			array(
			'name'=>'Value(IDR)',
			'value'=>'CHtml::encode(@$data->sub_total)',
		        'htmlOptions'=>array('style'=>'text-align:right','id'=>'subtotal'),
              		'footer'=>Yii::app()->numberFormatter->formatCurrency($this->getTotal($modelMaster->invoice_id),'Rp '),
			'footerHtmlOptions'=>array('style'=>'text-align:right;'),
			  ),                      
                       ),
			//'invoice_procent',
			//'ppn_procent',
			//'pph_procent',

		));


yang ane tanyakan gimana caranya nambahin baris lagi setelah footer(subtotal)....
mohon bantuannya gan...thx
0

#2 User is offline   agust 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 03-April 12

Posted 02 August 2012 - 09:26 PM

Wah koq belum ada yang jawab....
Ane punya masalah yang sama ni gan....

Udah tau jawabannya???
0

#3 User is offline   ahmadroni 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 250
  • Joined: 14-June 09
  • Location:Yogyakarta-Indonesia

Posted 04 August 2012 - 07:46 PM

View Postkarin, on 13 April 2012 - 09:26 PM, said:

maap ni agan2 semua ane masih newbie soal yii, ane mau nanya gimana caranya customize table cgridview...


view(gridview) begini...
$this->widget('zii.widgets.grid.CGridView', array(
		'id'=>'invoice-grid',
		'cssFile' => Yii::app()->baseUrl . '/css/printgridView/gridView.css',
		'dataProvider'=>$detail->searchDetail($modelMaster->invoice_id),
		
		'columns'=>array(
			array(
		     'name'=>'No',
		     'value'=>'$row+1',
			),
			'site_id',
			array(
		     'name'=>'site',							         value'=>'CHtml::encode(@$data->site_name)',										
			),
			array(
		     'name'=>'service_number',
      			'value'=>'CHtml::encode(@$data->material_service_number)',
			'htmlOptions'=>array('style'=>'text-align:center'),
			),
			array(
			'name'=>'material_service_description',
			'value'=>'CHtml::encode(@$data->material_service_description)', 
			),
			'po_number',
			array(
			'name'=>'grses_number',
			'value'=>'CHtml::encode(@$data->grses_number)',
			'htmlOptions'=>array('style'=>'text-align:center'),
			'footer'=>'Subtotal',
			),
			array(
			'name'=>'Value(IDR)',
			'value'=>'CHtml::encode(@$data->sub_total)',
	        	'htmlOptions'=>array('style'=>'text-align:right','id'=>'subtotal'),
              		'footer'=>Yii::app()->numberFormatter->formatCurrency($this->getTotal($modelMaster->invoice_id),'Rp '),
			'footerHtmlOptions'=>array('style'=>'text-align:right;'),
		  	),                      
                   	),
			//'invoice_procent',
			//'ppn_procent',
			//'pph_procent',

		));


yang ane tanyakan gimana caranya nambahin baris lagi setelah footer(subtotal)....
mohon bantuannya gan...thx


tinggal tambahin sedikit kok gan..
$this->widget('zii.widgets.grid.CGridView', array(
		'id'=>'invoice-grid',
		'cssFile' => Yii::app()->baseUrl . '/css/printgridView/gridView.css',
		'dataProvider'=>$detail->searchDetail($modelMaster->invoice_id),
	    'summaryText'=>'Jumlah Total : '. $nilai_total,
		'columns'=>array(
			array(
		     'name'=>'No',
		     'value'=>'$row+1',
			),
			'site_id',
			array(
		     'name'=>'site',							         value'=>'CHtml::encode(@$data->site_name)',									    
			),
			array(
		     'name'=>'service_number',
      			'value'=>'CHtml::encode(@$data->material_service_number)',
			'htmlOptions'=>array('style'=>'text-align:center'),
			),
			array(
			'name'=>'material_service_description',
			'value'=>'CHtml::encode(@$data->material_service_description)', 
			),
			'po_number',
			array(
			'name'=>'grses_number',
			'value'=>'CHtml::encode(@$data->grses_number)',
			'htmlOptions'=>array('style'=>'text-align:center'),
			'footer'=>'Subtotal',
			),
			array(
			'name'=>'Value(IDR)',
			'value'=>'CHtml::encode(@$data->sub_total)',
	        	'htmlOptions'=>array('style'=>'text-align:right','id'=>'subtotal'),
              		'footer'=>Yii::app()->numberFormatter->formatCurrency($this->getTotal($modelMaster->invoice_id),'Rp '),
			'footerHtmlOptions'=>array('style'=>'text-align:right;'),
		  	),                      
                   	),
			//'invoice_procent',
			//'ppn_procent',
			//'pph_procent',

		));

Hospital Cost Management System and
Hospital Management Information System
0

#4 User is offline   mbahsomo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 29-March 10

Posted 10 August 2012 - 01:59 AM

Wah - wah Mas @ahmadroni ....
4 jempol deh buat sampean


Merdeka
Sugik Puja Kusuma [mbahsomo]
http://sugik.do-event.com
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