Example #1
0
 /**
  * Adds an action to the current row.
  * 
  * This is in fact a little icon displayed on hovering the row. Clicking on it
  * will trigger an AJAX action.
  * @param string $icon Valid <uiControl::Icon>
  * @param string $label Action label (alt and tootltip text)
  * @param object $handler Object handling the action
  * @param string $method Objects method that handles the action
  * @return Table `$this`
  */
 function AddRowAction($icon, $label, $handler = false, $method = false)
 {
     if (!$this->_actions) {
         $this->_actions = $this->content(new Control('div'))->css('display', 'none')->css('position', 'absolute')->addClass('ui-table-actions');
     }
     $ra = new Control('span');
     $ra->class = "ui-icon ui-icon-{$icon}";
     $ra->title = $label;
     $ra->id = $ra->_storage_id;
     $ra->setData('action', $icon);
     $this->_actions->content($ra->wrap('div'));
     if ($handler && $method) {
         $this->_actionHandler[$icon] = array($handler, $method);
     }
     store_object($this);
     return $this;
 }