Heim >Backend-Entwicklung >PHP-Tutorial >yii2 treeGrid widget 中ActionColumn的问题
用了yii2的TreeGrid插件
如图中所示,按钮的ID和该列对应不上
<code>view代码 = TreeGrid::widget([ 'dataProvider' => $dataProvider, 'keyColumnName' => 'id', 'parentColumnName' => 'parent_id', 'parentRootValue' => '0', //first parentId value 'columns' => [ 'areaname', 'id', // 'parent_id', ['class' => 'yii\grid\ActionColumn', ] ] ]); ?> 控制器代码 public function actionIndex() { $areaObject = new CpArea(); $areaQuery = $areaObject::find()->orderBy('id'); $dataProvider = new ActiveDataProvider([ 'query' => $areaQuery, ]); return $this->render('index', [ 'dataProvider' => $dataProvider ]); } 我想问下 怎么做可以让后面的三个按钮和该列的id对应上</code>
用了yii2的TreeGrid插件
如图中所示,按钮的ID和该列对应不上
<code>view代码 = TreeGrid::widget([ 'dataProvider' => $dataProvider, 'keyColumnName' => 'id', 'parentColumnName' => 'parent_id', 'parentRootValue' => '0', //first parentId value 'columns' => [ 'areaname', 'id', // 'parent_id', ['class' => 'yii\grid\ActionColumn', ] ] ]); ?> 控制器代码 public function actionIndex() { $areaObject = new CpArea(); $areaQuery = $areaObject::find()->orderBy('id'); $dataProvider = new ActiveDataProvider([ 'query' => $areaQuery, ]); return $this->render('index', [ 'dataProvider' => $dataProvider ]); } 我想问下 怎么做可以让后面的三个按钮和该列的id对应上</code>
您好,有QQ吗,请联系,有点技术的问题希望和您交流下,我的QQ是97521142