Yii Framework Forum: How To Pass Params To Url In Tbeditablecolum - Yii Framework Forum

Jump to content

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

How To Pass Params To Url In Tbeditablecolum Rate Topic: -----

#1 User is offline   nullne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-May 13

Posted 14 July 2013 - 06:02 PM

$this->widget('bootstrap.widgets.TbExtendedGridView', array(
.....
array(
'name' => 'status',
'class' => 'bootstrap.widgets.TbEditableColumn',
'headerHtmlOptions' => array('style' => ''),
'editable' => array(
'type' => 'select',
'url'=>$this->createUrl('/user/manage'),
'source'=>array(0=>'pending',1=>'confirmed',2=>'banned'),
'success'=>'js:function(response,newValue){
alert(response);
}',
)
),
array(
'name'=>'warned',
'header'=>'WARNED',
'class'=>'bootstrap.widgets.TbToggleColumn',
'toggleAction'=>$this->createUrl('user/manage'),
),
......
);

Attached File  QQ图片20130715070053.jpg (46.08K)
Number of downloads: 7

i don't know how to handle it
i just wannt to reach like this
'url'=>$this->createUrl('/user/manage',array('id'=>$data->id)),
but $data is not defined here.
i am confused about this ,i do not know how to use $data
0

#2 User is offline   codesutra 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 596
  • Joined: 15-March 11
  • Location:India

Posted 15 July 2013 - 12:36 AM

View Postnullne, on 14 July 2013 - 06:02 PM, said:

$this->widget('bootstrap.widgets.TbExtendedGridView', array(
.....
array(
'name' => 'status',
'class' => 'bootstrap.widgets.TbEditableColumn',
'headerHtmlOptions' => array('style' => ''),
'editable' => array(
'type' => 'select',
'url'=>$this->createUrl('/user/manage'),
'source'=>array(0=>'pending',1=>'confirmed',2=>'banned'),
'success'=>'js:function(response,newValue){
alert(response);
}',
)
),
array(
'name'=>'warned',
'header'=>'WARNED',
'class'=>'bootstrap.widgets.TbToggleColumn',
'toggleAction'=>$this->createUrl('user/manage'),
),
......
);

Attachment QQ图片20130715070053.jpg

i don't know how to handle it
i just wannt to reach like this
'url'=>$this->createUrl('/user/manage',array('id'=>$data->id)),
but $data is not defined here.
i am confused about this ,i do not know how to use $data



Try something like this
'url' =>'$this->createUrl("/user/manage",array("id"=>$data->id))',

CodeSutra
0

#3 User is offline   nullne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-May 13

Posted 15 July 2013 - 01:02 AM

View Postcodesutra, on 15 July 2013 - 12:36 AM, said:

Try something like this
'url' =>'$this->createUrl("/user/manage",array("id"=>$data->id))',



i tried ;code like this
Attached File  view&controller.jpg (70.29K)
Number of downloads: 12

and result like this:
Attached File  result.jpg (39.54K)
Number of downloads: 8
sorry,could you give me anather help?
0

#4 User is offline   Peter @ Liverpool 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-March 12

Posted 13 April 2014 - 07:47 AM

Please help - I have the same problem here - it will not recognise
$data->local_policy_id
but other columns in the grid use this successfully. This is not very well documented on any of the websites for TbEditableColumn :(

$this->widget('bootstrap.widgets.TbExtendedGridView',
        array( 'template' => "{items}", 
               'columns' => array(
                  array(
                    'name' => 'local_policy_id' ,
                    'header' => 'ID' ,
                    'type' => 'raw' ,
                    'sortable' => false ,
                    'value' => '$data->local_policy_id'
                  ) , 
                  array(     
                     'id' => 'billing_level' ,     
                     'name' => 'billing_level' ,     
                     'header' => 'Billing Desc' ,     
                     'class' => 'bootstrap.widgets.TbEditableColumn' ,        
                        'editable' => array(             
                             'url' => $this->createUrl("localPolicy/inlineEditable", 
                                   array( "name" => "billing_level" 
                                    , "model" => "UwLocalPolicy"
                                    , "pk" => $data->local_policy_id ))  
                  )
         ) ,


The first column [local_policy_id] shows the ID but I cannot get the second column to bind this number to the URL for the editable action. It is so frustrating as it is the key element setting the PK.

Any help gratefully received,

Peter - Annoyed of Liverpool

Attached File(s)


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