Grido\Components\Columns\Column::getHeaderPrototype PHP Method

getHeaderPrototype() public method

Returns header cell prototype ( html tag).
public getHeaderPrototype ( ) : Nette\Utils\Html
return Nette\Utils\Html
    public function getHeaderPrototype()
    {
        if ($this->headerPrototype === NULL) {
            $this->headerPrototype = \Nette\Utils\Html::el('th')->setClass(['column', 'grid-header-' . $this->getName()]);
        }
        if ($this->isSortable() && $this->getSort()) {
            $this->headerPrototype->class[] = $this->getSort() == self::ORDER_DESC ? 'desc' : 'asc';
        }
        return $this->headerPrototype;
    }

Usage Example

Example #1
0
 /**
  * Returns header cell prototype (<th> html tag).
  * @return \Nette\Utils\Html
  */
 public function getHeaderPrototype()
 {
     $th = parent::getHeaderPrototype();
     if ($this->isEditable()) {
         $th->data['grido-editable-handler'] = $this->link('editable!');
         $th->data['grido-editableControl-handler'] = $this->link('editableControl!');
     }
     return $th;
 }
All Usage Examples Of Grido\Components\Columns\Column::getHeaderPrototype