]> _ Git - cubist_cms-back.git/commitdiff
#2810
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Jun 2019 16:44:09 +0000 (18:44 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Jun 2019 16:44:09 +0000 (18:44 +0200)
src/app/Magic/Controllers/CubistMagicControllerTrait.php
src/app/Magic/Models/CubistMagicAbstractModel.php

index 10928d10485ff60726bd4a60969ff936e58a8d5d..dd96ae19139201a9cdfb97fdb7831e306d555278 100644 (file)
@@ -45,12 +45,18 @@ trait CubistMagicControllerTrait
         | CrudPanel Configuration
         |--------------------------------------------------------------------------
         */
-        foreach ($this->getModelInstance()->getFields() as $field) {
+
+        $model = $this->getModelInstance();
+
+         $this->crud->addColumn(['name' => $model->getPrimaryKey(), 'type' => 'number', 'label' => "#"]);
+
+        foreach ($model->getFields() as $field) {
             $this->addField($field);
         }
 
     }
 
+
     public function addField($field)
     {
         if (is_array($field)) {
index 7d2534315d2eef6205604b975fd3593c32052933..d808b778b1845a3b3442fe3b7de0e927634b7183 100644 (file)
@@ -98,6 +98,11 @@ class CubistMagicAbstractModel extends Model
         return $model;
     }
 
+    public function getPrimaryKey()
+    {
+        return $this->primaryKey;
+    }
+
 
     public function setFields()
     {