public function renderTableRow($model, $key, $index)
    {
        $cells = [];
        /* @var $column TreeColumn */
        foreach ($this->columns as $column) {
            $cells[] = $column->renderDataCell($model, $key, $index);
        }
        if ($this->rowOptions instanceof Closure) {
            $options = call_user_func($this->rowOptions, $model, $key, $index, $this);
        } else {
            $options = $this->rowOptions;
        }
        $options['data-key'] = is_array($key) ? json_encode($key) : (string) $key;

        $id = ArrayHelper::getValue($model, $this->keyColumnName);
        Html::addCssClass($options, "treegrid-$id");

        $parentId = ArrayHelper::getValue($model, $this->parentColumnName);
        if ($parentId) {
            if(ArrayHelper::getValue($this->pluginOptions, 'initialState') == 'collapsed'){
                Html::addCssStyle($options, 'display: none;');
            }
            Html::addCssClass($options, "treegrid-parent-$parentId");
        }

        return Html::tag('tr', implode('', $cells), $options);
    }
public function renderTableRow($model, $key, $index)
    {
        $cells = [];
        /* @var $column TreeColumn */
        foreach ($this->columns as $column) {
            $cells[] = $column->renderDataCell($model, $key, $index);
        }
        if ($this->rowOptions instanceof Closure) {
            $options = call_user_func($this->rowOptions, $model, $key, $index, $this);
        } else {
            $options = $this->rowOptions;
        }
        $options['data-key'] = is_array($key) ? json_encode($key) : (string) $key;

        $id = ArrayHelper::getValue($model, $this->keyColumnName);
        Html::addCssClass($options, "treegrid-$id");

        $parentId = ArrayHelper::getValue($model, $this->parentColumnName);
        if ($parentId) {
            if(ArrayHelper::getValue($this->pluginOptions, 'initialState') == 'collapsed'){
                Html::addCssStyle($options, 'display: none;');
            }
            Html::addCssClass($options, "treegrid-parent-$parentId");
        }

        return Html::tag('tr', implode('', $cells), $options);
    }
public function renderTableRow ( $ model , $ key , $ index ) { $ cells = [ ] ; /* @var $column TreeColumn */ foreach ( $ this -> columns as $ column ) { $ cells [ ] = $ column -> renderDataCell ( $ model , $ key , $ index ) ; } if ( $ this -> rowOptions instanceof Closure ) { $ options = call_user_func ( $ this -> rowOptions , $ model , $ key , $ index , $ this ) ; } else { $ options = $ this -> rowOptions ; } $ options [ 'data-key' ] = is_array ( $ key ) ? json_encode ( $ key ) : ( string ) $ key ; $ id = ArrayHelper :: getValue ( $ model , $ this -> keyColumnName ) ; Html :: addCssClass ( $ options , "treegrid-$id" ) ; $ parentId = ArrayHelper :: getValue ( $ model , $ this -> parentColumnName ) ; if ( $ parentId ) { if ( ArrayHelper :: getValue ( $ this -> pluginOptions , 'initialState' ) == 'collapsed' ) { Html :: addCssStyle ( $ options , 'display: none;' ) ; } Html :: addCssClass ( $ options , "treegrid-parent-$parentId" ) ; } return Html :: tag ( 'tr' , implode ( '' , $ cells ) , $ options ) ; }
Renders a table row with the given data model and key.
@param mixed $model the data model to be rendered
@param mixed $key the key associated with the data model
@param integer $index the zero-based index of the data model among the model array returned by [[dataProvider]].
@return string the rendering result
Renders a table row with the given data model and key .