From 49755e8212683a95371b3837e236ebc125fb1af6 Mon Sep 17 00:00:00 2001 From: liyunfang <381296986@qq.com> Date: Thu, 26 Nov 2015 18:07:14 +0800 Subject: [PATCH] Get through the plug-in configuration collapsed Get through the plug-in configuration collapsed --- TreeGrid.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TreeGrid.php b/TreeGrid.php index 3f74255..c53e005 100644 --- a/TreeGrid.php +++ b/TreeGrid.php @@ -145,8 +145,6 @@ class TreeGrid extends Widget { * @see \yii\grid::$columns for details. */ public $columns = []; - - public $collapsed = true; /** * Initializes the grid view. * This method will initialize required property values and instantiate [[columns]] objects. @@ -250,7 +248,7 @@ public function renderTableRow($model, $key, $index) $parentId = ArrayHelper::getValue($model, $this->parentColumnName); if ($parentId) { - if($this->collapsed){ + if('collapsed' == ArrayHelper::getValue($this->pluginOptions, 'initialState')){ Html::addCssStyle($options, 'display: none;'); } Html::addCssClass($options, "treegrid-parent-$parentId");