示例#1
0
文件: Grid.php 项目: arhe/pwak
 /**
  *
  * @access public
  * @return void
  */
 public function NewAction($actionType, $params = array())
 {
     $className = 'GridAction' . $actionType;
     loadGridComponent('Action', $className);
     $params['JsOwnerForm'] = $this->javascriptFormOwnerName == 'document.forms[0]' ? 'document.forms[0]' : 'document.forms[\'' . $this->javascriptFormOwnerName . '\']';
     $action = new $className($params);
     $this->_Action[] = $action;
     $action->index = $this->_getActionCount() - 1;
     if ($action->renderer == 'Inline') {
         $this->hasInlineActions = true;
     }
     return $action;
 }
示例#2
0
 /**
  * AbstractGrid::NewColumn()
  *
  * @param  $columnType
  * @param  $title
  * @param array $params
  * @return object AbstractGridColumn
  */
 public function NewColumn($columnType, $title, $params = array())
 {
     if ($this->withNoSortableColumn) {
         $params['Sortable'] = false;
     }
     $className = 'GridColumn' . $columnType;
     loadGridComponent('Column', $className);
     $column = new $className($title, $params);
     $column->index = count($this->columns);
     $column->groupCount = 0;
     $this->columns[$column->index] = $column;
     return $column;
 }