/**
  * Renders an ajaxlink button.
  * @param string $id the ID of the button
  * @param array $button the button configuration which may contain 'label', 'url', 'imageUrl' and 'options' elements.
  * See {@link buttons} for more details.
  * @param integer $row the row number (zero-based)
  * @param mixed $data the data object associated with the row
  */
 protected function renderButton($id, $button, $row, $data)
 {
     $options = isset($button['options']) ? $button['options'] : array();
     //Required else id assigned to update button is same as create task link in top nav bar
     //opening create task instead of edit task
     $options['id'] = $button['gridId'] . '-' . $data->id;
     $button['options'] = $options;
     return parent::renderButton($id, $button, $row, $data);
 }
Пример #2
0
 /**
  * @param string $id
  * @param array $button
  * @param int $row
  * @param mixed $data
  */
 protected function renderButton($id, $button, $row, $data)
 {
     // add rel-attribute to update-button
     if ($id == 'update') {
         $button['options']['rel'] = CHtml::normalizeUrl(array('entry/getData', 'id' => $data->id, 'withPassword' => 1));
     }
     // render website only if url available
     if ($id != 'website' || strlen($data->url) > 0) {
         parent::renderButton($id, $button, $row, $data);
     }
 }