From c0acac4b1b8ddb339baba27475edd3f31ba36567 Mon Sep 17 00:00:00 2001 From: Yohanes Candrajaya Date: Wed, 17 Feb 2016 20:58:20 +0700 Subject: [PATCH] fixes #34 --- crud/default/views/_dataref.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crud/default/views/_dataref.php b/crud/default/views/_dataref.php index 93bc19f..1d6e6c3 100644 --- a/crud/default/views/_dataref.php +++ b/crud/default/views/_dataref.php @@ -11,7 +11,18 @@ $dataProvider = new ArrayDataProvider([ 'allModels' => $model->, +primaryKey) > 1): + $key = []; + foreach ($tableSchema->primaryKey as $pk) { + $key[] = "'$pk' => \$model->$pk"; + } +?> + 'key' => function($model){ + return []; + } + 'key' => 'primaryKey[0] ?>' + ]); $gridColumns = [ ['class' => 'yii\grid\SerialColumn'],