Questions tagged [cbuttoncolumn]

41 questions
11
votes
3 answers

How to disable cgridview view button or setting visiability to false

can some buddy please suggest how to disable view button on cgridview widget and how to add more button like active.. $this->widget('zii.widgets.grid.CGridView',…
Coder
  • 153
  • 1
  • 2
  • 10
10
votes
4 answers

CGridview conditional delete button

I want the delete button to be active only in certain condition in CGgridView CButtonColumn (or make a custom delete button) e g if user=='admin' or status=='draft'. Any ideas? Thanks!
zuups
  • 1,140
  • 1
  • 11
  • 17
4
votes
5 answers

Access to the $data variable from buttons in cgridview

Is the any way, to access model located in $data variable from CButtonColumn? Below code is not working. array( 'class' => 'CButtonColumn', 'template' => '{test}', 'buttons' => array( 'test' => array( 'label' => 'Select', …
gryfi
  • 61
  • 1
  • 3
4
votes
3 answers

CButtonColumn for another model in CGridView

I'm showing a CGridView for another related model in view&id=n page. The necessary relations are included in model files and everything works just fine. The only thing is that the buttons in the CButtonColumn are linked to the appropriate actions of…
Azimuth
  • 2,599
  • 4
  • 26
  • 33
3
votes
1 answer

How can I change cbuttoncolumn label dynamically in yii cgridview

I am trying to change cbuttoncolumn label dyanamically. But somehow it does not work. My code is array( 'class'=>'CButtonColumn', 'template'=>'{publish}', 'buttons'=>array( 'publish'=>array( …
Sunil Shrestha
  • 208
  • 1
  • 4
  • 13
3
votes
2 answers

customize a CButtonColumn with an Html link

I use CButtonColumn look like this: array('header'=>'Operations', 'class'=>'CButtonColumn', 'template'=>'{view}{update}', 'buttons'=>array ('view' => array ('url'=>'Yii::app()->createUrl("Unit/view", array("id"=>$data->Id))',), It works fine, but…
Mushroom
  • 285
  • 2
  • 17
3
votes
2 answers

How do you add a button to a CGridView?

Sounds simple, right? I've searched high and low and I can't find out how to do this. I have a CGridView: $dataProvider = new CArrayDataProvider ($auctions); $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$dataProvider, …
rockstardev
  • 13,479
  • 39
  • 164
  • 296
2
votes
2 answers

CGridView add another delete button with ajax post request

Hello is it possible to add another delete button to Yii CGridView? I would like it to make an ajax post request to one of mine controllers. An use case would be: Lets say I have a blog entry with comments. In administration I would like to have a…
netuser24
  • 86
  • 1
  • 9
2
votes
2 answers

Button image is not working properly

I recently added a image to the edit button in YII.I do the following, 'class'=>'CButtonColumn', 'header' => 'Edit', 'template' => '{Edit}', 'buttons' => array( 'Edit' =>array( 'label' => 'Edit', …
tnchalise
  • 1,573
  • 2
  • 18
  • 38
1
vote
1 answer

CGridView CbutonColumn Custom Button Click not working

I am using a CGridView in which I have a CButtonColumn for which I have defined a button. the "click" js is not being called. The URL is called though and completes. I want to show a confirmation to the user but it never shows up. According to the…
Orlymee
  • 2,349
  • 1
  • 22
  • 24
1
vote
2 answers

Setting returnURL for CButtonColumn button

I'm looking at the controller for the default Delete button in the CButtonColumn class. It manages to return to the previous web-page after deleting a CGridView line and remain on the same page of the CGridView, as opposed to going to the first…
Epicurus
  • 2,103
  • 7
  • 29
  • 39
1
vote
2 answers

Is possible to disable update button from CButtonColumn for first two values in Yii

In my Yii web application, I want to disable update link for first two values in CButtonColumn. How to resolve this. My Cgridview is, Please help me.
Arya
  • 504
  • 2
  • 8
  • 31
1
vote
3 answers

when I click view button in CGridView, it is opened in a new window

I used from CGridView in framework Yii, I want when I click view button , it is opened in a new window how can I add of "_new" of target ?
maryam
  • 584
  • 9
  • 26
1
vote
3 answers

Yii CGridView button - call parametrized javascript function

I need to create a CGridView with one button and make the button call javascript function like this: $this->widget('zii.widgets.grid.CGridView', array( 'id' => 'projectCities', 'summaryText' => '', 'dataProvider' =>…
Joe
  • 2,551
  • 6
  • 38
  • 60
1
vote
1 answer

CButtonColumn, Visibility Nested Exception in CGridView

I have currently created a CButtonColumn in my CGridView to display several options for related models. Like this 'buttons' => array( 'publish' => array( 'label' => 'Publish', 'visible' =>…
user1845192
1
2 3