Yii Framework Forum: [Help] Ambil Variabel Di Luar Gridview On Cbuttoncolumn Click - Yii Framework Forum

Jump to content

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

[Help] Ambil Variabel Di Luar Gridview On Cbuttoncolumn Click mohon pencerahannya all yii lover... Rate Topic: -----

#1 User is offline   zillucks 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 22-March 13

Posted 27 June 2013 - 11:11 PM

Help me dong,masih nooobb bgt nih sama yii...
gimana yah caranya nangkep variabel radiobutton status pada waktu cbuttoncolumn pilih di click
    <tr>
        <td>Status</td>
        <td>:
            <?php
            echo CHtml::radioButtonList('status',2,
                array(1=>'s_1',2=>'s_2'),
                array(
                    'separator'=>'&nbsp;&nbsp;&nbsp;',
                    'template'=>'{input}&nbsp;&nbsp;{label}',
                    'labelOptions'=>array('style'=>'display:inline'),
                )
            );
            ?>
        </td>
    </tr>
    <tr>
        <td align="center" colspan="2">
            <?php
            $this->widget('bootstrap.widgets.TbGridView',array(
                'type'=>'striped bordered condensed',
                'id'=>'grid-dosenAll',
                'dataProvider'=>$data,
                'summaryText'=>'',
                'ajaxUpdate'=>true,
                'columns'=>array(
                    'Nama',
                    array(
                        'class'=>'bootstrap.widgets.TbButtonColumn',
                        'header'=>'PILIH',
                        'template'=>'{pilih}',
                        'buttons'=>array(
                            'pilih'=>array(
                                'imageUrl'=>Yii::app()->request->baseUrl.'/images/checkmark-ico.png',
                                'url'=>'array(
                                    "/site/pilihbarang",
                                    "idbarang"=>"'.$idbarang.'",
                                    "idsup"=>$data["idsup"],
                                    "status"=>"$(\'#status :checked\').val()",
                                )',
                                'options'=>array(
                                    'id'=>'btnpilih',
                                ),
                            ),
                        ),
                    ),
                )
            ));
            ?>
        </td>
    </tr>


thx before =.
0

#2 User is offline   rei 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 323
  • Joined: 10-November 10

Posted 30 June 2013 - 01:34 AM

Kalo pake event onClick bisa gak, gan?

'pilih'=>array(
   'url'=>'array(
      "/site/pilihbarang",
      "idbarang"=>"'.$idbarang.'",
      "idsup"=>$data["idsup"],
      "status"=>1,
   )',
   'click'=>'function(){
      var link = $(this).attr("href").slice(0, $(this).attr("href").lastIndexOf("=")+1);
      $(this).attr("href", link + $(\'#status :checked\').val());
   }',
   ...
),



Ane juga gak yakin kalo ini cara paling gampang. Kalo ketemu cara yang lebih mudah, mohon pencerahannya, ya, suhu. :D
Fipick - Find and pick recommendations
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