Creates children components for rendering column headers.

@param Grid $grid
175945
protected function createHeaders(Grid $grid)
    {
        foreach ($grid->getConfig()->getColumns() as $column) {
            $this->addComponent(new ColumnHeader($column));
        }
    }
703126
private void initGrid() {
        // Setting up images grid
        final int cols = getResources().getInteger(R.integer.images_grid_columns);

        views.grid.setLayoutManager(new GridLayoutManager(this, cols));

        gridAdapter = new PhotoListAdapter(this);
        gridAdapter.setLoadingOffset(PAGE_SIZE / 2);
        gridAdapter.setCallbacks(new EndlessRecyclerAdapter.LoaderCallbacks() {
            @Override
            public boolean canLoadNextItems() {
                return gridAdapter.canLoadNext();
            }

            @Override
            public void loadNextItems() {
                // We should either load all items that were loaded before state save / restore,
                // or next page if we already loaded all previously shown items
                int count = Math.max(savedPhotoCount, gridAdapter.getCount() + PAGE_SIZE);
                Events.create(FlickrApi.LOAD_IMAGES_EVENT).param(count).post();
            }
        });
        views.grid.setAdapter(gridAdapter);
    }
1224187
private function gridFooterBuild()
    {
        $html = '<tfoot class="table-header">' . self::$EOL;
        $html .= '<tr>' . self::$EOL;

        if (!isset($this->_arrayData['config']['disableckeckall']) or $this->_arrayData['config']['disableckeckall'] != 'true') {
            $html .= '<th class="nosorter width-select">&nbsp;</th>' . self::$EOL;
        }

        foreach ($this->_arrayData['header'] as $value) {

            $class = '';
            if (isset($value['class']) and !empty($value['class'])) {
                $class .= $value['class'];
            }

            if (isset($value['sortable']) and $value['sortable'] == 'false') {
                $class .= ' nosorter ';
            }

            if (isset($value['searchable']) and $value['searchable'] == 'false') {
                $class .= ' filter-false ';
            }

            if (isset($value['type'])) {
                switch ($value['type']) {
                    case 'datetime':
                        $class .= ' width-datetime ';
                        break;
                    case 'date':
                        $class .= ' width-date ';
                        break;
                    case 'status':
                        $class .= ' width-status ';
                        break;
                    case 'primarykey':
                        $class .= ' width-primary ';
                        break;
                    case 'integer':
                    case 'int':
                    case 'float':
                    case 'double':
                    case 'decimal':
                        $class .= ' width-number ';
                        break;
                    case 'money':
                        $class .= ' width-money ';
                        break;
                    case 'char':
                        $class .= ' width-shortstring ';
                        break;
                    case 'varchar':
                        $class .= ' width-mediumstring ';
                        break;
                    default:
                        break;
                }
            }

            $html .= "<th class='{$class}'>" . $value['value'] . '</th>' . self::$EOL;
        }
        if (!isset($this->_arrayData['config']['disablebuttons']) or $this->_arrayData['config']['disablebuttons'] != 'true') {
            $html .= '<th class="nosorter width-action">' . 'Ação' . '</th>';
        }
        $html .= '</tr>' . self::$EOL;

        $html .= '<tr><th colspan="' . $this->_datagridColumnCount . '" class="pager form-horizontal text-left">
                            <button type="button" class="btn first"><i class="glyphicon glyphicon-step-backward"></i></button>
                            <button type="button" class="btn prev"><i class="glyphicon glyphicon-arrow-left"></i></button>
                            <span class="pagedisplay"></span> <!-- this can be any element, including an input -->
                            <button type="button" class="btn next"><i class="glyphicon glyphicon-arrow-right"></i></button>
                            <button type="button" class="btn last"><i class="glyphicon glyphicon-step-forward"></i></button>
                            <select class="pagesize input-sm" title="Select page size">
                                <option selected="selected" value="10">10</option>
                                <option value="20">20</option>
                                <option value="30">30</option>
                                <option value="40">40</option>
                                <option value="50">50</option>
                                <option value="100">100</option>
                            </select>
                            <select class="pagenum input-sm" title="Select page number"></select>
                        </th>
                    </tr>' . self::$EOL;

        $html .= '</tfoot>' . self::$EOL;

        return $html;
    }
506557
private function createBodyRow($columns, $data)
    {
        $id = null;

        // Columns to be used when creating a row
        $children = array();

        // Handle batch callback and state
        if ($this->options[self::GRID_PARAM_BATCH] === true) {
            // Apply callback if provided
            if (isset($this->options[self::GRID_PARAM_BATCH_CALLBACK]) && is_callable($this->options[self::GRID_PARAM_BATCH_CALLBACK])) {
                // Result of batch callback function call
                $batchRequired = (bool) call_user_func($this->options[self::GRID_PARAM_BATCH_CALLBACK], $data);
            } else {
                // By default, batch is required for all rows
                $batchRequired = true;
            }

            if ($batchRequired) {
                $batchOutput = Element::checkbox($this->createInputName(self::GRID_PARAM_BATCH, $data[$this->getPkColumn()]), false, array(), false);
            } else {
                $batchOutput = null;
            }

            $children[] = $this->createColumn(null, $batchOutput);
        }
        // Done handling batch

        foreach ($columns as $configuration) {
			$column = $configuration[self::GRID_PARAM_COLUMN];
			$value = isset($data[$column]) ? $data[$column] : null;

            // Ignore if configuration for current column isn't provided
            if (!$this->hasColumnConfiguration($column)) {
                continue;
            }

            // Grab the ID
            if ($this->getPkColumn() !== false && $this->isPkColumnName($column)) {
                $id = $value;
            }

            // Grab column attributes if present
            $tdAttributes = isset($configuration[self::GRID_PARAM_TD_ATTRIBUTES]) ? $configuration[self::GRID_PARAM_TD_ATTRIBUTES] : array();

            // Find out whether current row is editable or not
            $editable = $this->findOptionByColumn($column, self::GRIG_PARAM_EDITABLE);
            // Get custom value (which is provided by a callback) if possible
            $callback = $this->findOptionByColumn($column, self::GRID_PARAM_VALUE);

            // If a callback function is provided for custom value, then use its returned value providing current row as argument
            if ($callback instanceof Closure) {
                $value = $callback($data);
            }

            // If translation isn't defined, assume true by default
            if (!isset($configuration[self::GRID_PARAM_TRANSLATEABLE])) {
                $configuration[self::GRID_PARAM_TRANSLATEABLE] = false;
            }

            // Translate if required
            if ($configuration[self::GRID_PARAM_TRANSLATEABLE] == true && $this->hasTranslator()) {
                $value = $this->translator->translate($value);
            }

            if ($editable == true) {
                $name = $this->createInputName($column, $id);
                $filter = $this->findOptionByColumn($column, self::GRID_PARAM_FILTER);

                if (is_array($filter)) {
                    $column = $this->createInput('createColumn', $column, $name, $value, $filter);
                } else {
                    $column = $this->createInput('createColumn', $column, $name, $value);
                }

            } else {
                $column = $this->createColumn(null, $value, $tdAttributes);
            }

            // Push prepared element
            $children[] = $column;
        }

        // If action columns provided, then create action links
        if ($this->hasActions()) {
            $links = array();

            foreach ($this->options[self::GRID_PARAM_ACTIONS] as $name => $callback) {
                // Append only if callable type provided as a value
                if (is_callable($callback)) {
                    $links[] = $callback($data);
                }
            }

            $children[] = $this->createColumn(null, join(PHP_EOL, $links));
        }

        // Now append row attributes if defined
        $attributes = array();

        if (isset($this->options[self::GRID_PARAM_ROW_ATTRS])) {
            foreach($this->options[self::GRID_PARAM_ROW_ATTRS] as $name => $value) {
                // If closure is provided, then execute it and get returned value
                if (is_callable($value)) {
                    $value = $value($data);
                }

                // Don't append NULL-like attributes
                if ($value != null) {
                    $attributes[$name] = $value;
                }
            }
        }

        return $this->createTableRow($children, $attributes);
    }
327512
protected function renderHeaderCellContent()
    {
        if(yii::app()->editable->form != EditableConfig::FORM_BOOTSTRAP) {
            parent::renderHeaderCellContent();
            return;
        }
        
        if ($this->grid->enableSorting && $this->sortable && $this->name !== null)
        {
            $sort = $this->grid->dataProvider->getSort();
            $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);

            if ($sort->resolveAttribute($this->name) !== false)
                $label .= '<span class="caret"></span>';

            echo $sort->link($this->name, $label, array('class'=>'sort-link'));
        }
        else
        {
            if ($this->name !== null && $this->header === null)
            {
                if ($this->grid->dataProvider instanceof CActiveDataProvider)
                    echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
                else
                    echo CHtml::encode($this->name);
            }
            else
                parent::renderHeaderCellContent();
        }
    }
115715
private function initialise()
    {
        for ($i = 0; $i < $this->size; $i++) {
            for ($j = 0; $j < $this->size; $j++) {
                $this->grid[$i][$j] = null;
            }

            $this->rowsAvailable[] = $i;
            $this->columnsAvailable[] = $i;
        }
    }
1297753
public void createCubicGrid() {
        //		logger.debug("	CREATE CUBIC GRID");
        gridGenerator.setDimension(findGridBoundaries(), true);
        gridGenerator.generateGrid();
        this.grid = gridGenerator.getGrid();
    }
523029
private function fill()
    {
        foreach ($this->grid as $r => $row) {
            foreach ($row as $c => $cell) {
                if ($cell === null) {
                    $this->grid[$r][$c] = $this->alphabet->randomLetter();
                }
            }
        }
        // fill them
    }
940230
public function renderHeaderCell()
	{
		if ($this->grid->json) {
			$this->headerHtmlOptions['id'] = $this->id;
			if ($this->grid->json) {
				return CMap::mergeArray(
					$this->headerHtmlOptions,
					array('content' => $this->renderHeaderCellContent())
				);
			}
		}
		parent::renderHeaderCell();
	}
27184
function RenderGrid()
	{
	global $gSQLBlockRows; // used by rs2html to indicate how many rows to display
		include_once(ADODB_DIR.'/tohtml.inc.php');
		ob_start();
		$gSQLBlockRows = $this->rows;
		rs2html($this->rs,$this->gridAttributes,$this->gridHeader,$this->htmlSpecialChars);
		$s = ob_get_contents();
		ob_end_clean();
		return $s;
	}
1219644
protected function createComponentRolesList(): DataGrid
	{
		$grid = $this->dataGridFactory->create();

		$grid->setDataSource($this->orm->aclRoles->findRoles($this->viewSuperadmin));

		$grid->addColumnText('title', 'cms.permissions.role')
			->setEditableInputType('text')
			->setEditableCallback([$this, 'setRoleTitle']);

		$grid->addColumnText('name', 'cms.permissions.name')
			->setEditableInputType('text')
			->setEditableCallback([$this, 'setRoleName']);

		$grid->addColumnText('parent', 'cms.permissions.parent')
			->setRenderer(function (AclRole $role) {
				if (!empty($role->parent)) {
					return $role->parent->title;
				}
				return null;
			})
			->setEditableInputTypeSelect([0 => $this->translate('form.none')] + $this->orm->aclRoles->fetchPairs($this->viewSuperadmin))
			->setEditableCallback([$this, 'setRoleParent']);

		$grid->addAction('edit', null, 'editRolePermissions')
			->setIcon('pencil')
			->setTitle('default.edit');

		$grid->addAction('delete', null, 'deleteRole!')
			->setIcon('trash')
			->setTitle('default.delete')
			->setClass('btn btn-xs btn-danger ajax')
			->setConfirm(function (AclRole $role) {
				return $this->translate('cms.permissions.confirmDeleteRole', 1, ['name' => $role->title]);
			});

		$add = $grid->addInlineAdd()
			->setPositionTop()
			->setTitle('cms.permissions.addRole');
		$add->onControlAdd[] = [$this, 'roleForm'];
		$add->onSubmit[] = [$this, 'addRole'];

		$grid->addGroupAction('default.delete')->onSelect[] = [$this, 'deleteRoles'];

		return $grid;
	}
381045
function init(grid) {
      options = $.extend(true, {}, _defaults, options);
      _grid = grid;
      if (options.enableForCells) _grid.onMouseEnter.subscribe(handleMouseEnter);
      if (options.enableForHeaderCells) _grid.onHeaderMouseEnter.subscribe(handleHeaderMouseEnter);
    }
193604
private function gridHeaderBuild() {
        $html = '<thead class="table-header">' . self::$phpEOL;

        $html .= $this->gridHeaderLabel();
        if ($this->searchEnable) {
            $html .= $this->gridHeaderSearch();
        }

        $html .= '</thead>' . self::$phpEOL;

        return $html;
    }
652170
protected function buildFromArray(array $grid)
    {
        $this->rows = count($grid);
        $columns = array_reduce(
            $grid,
            function ($carry, $value) {
                return max($carry, is_array($value) ? count($value) : 1);
            },
            0
        );
        $this->columns = $columns;

        array_walk(
            $grid,
            function (&$value) use ($columns) {
                if (!is_array($value)) {
                    $value = [$value];
                }
                $value = array_pad(array_values($value), $columns, null);
            }
        );

        $this->grid = $grid;
    }
492426
public function createGridLayout($itemsInGrid, $numberOfCols)
    {
        $position = 1;
        $columns = new ArrayList();
        $result = new ArrayList();
        foreach ($itemsInGrid as $key => $item) {
            $columns->push($item);
            if (($position) >= $numberOfCols) {
                $position = 1;
                $row = new ArrayList();
                $row->Columns = $columns;
                $result->push($row);
                $columns = new ArrayList();
            } else {
                $position = $position + 1;
            }
        }
        if ($columns->Count() > 0) {
            $row = new ArrayList();
            $row->Columns = $columns;
            $result->push($row);
        }
        return $result;
    }
316397
protected function renderHeaderCellContent()
    {

        if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
            $sort = $this->grid->dataProvider->getSort();
            $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);

            if ($sort->resolveAttribute($this->name) !== false)
                $label .= '<span class="caret"></span>';

            echo $sort->link($this->name, $label, array('class' => 'sort-link'));
        } else {
            if ($this->name !== null && $this->header === null) {
                if ($this->grid->dataProvider instanceof CActiveDataProvider)
                    echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
                else
                    echo CHtml::encode($this->name);
            } else
                parent::renderHeaderCellContent();
        }
    }
58213
function init(grid) {
    _grid = grid;

    $(_grid.getCanvasNode()).on('mouseover', '.slick-row', showToolTip);
    $(_grid.getCanvasNode()).on('mouseout', '.slick-row', hideToolTip);
    $(_grid.getCanvasNode()).on('mouseup', hideAll);

    // $(_grid.getContainerNode()).on('mouseover', '.slick-header-column',
    // showHeaderToolTip);
    // $(_grid.getContainerNode()).on('mouseout', '.slick-header-column',
    // hideHeaderToolTip);

  }