public function listAction()
 {
     /* @var $grid \ZfcDatagrid\Datagrid */
     /* @var $em EntityManager */
     $serviceLocator = $this->getServiceLocator();
     $config = $serviceLocator->get('config');
     $entityClass = $config['zfcuser']['userEntityClass'];
     $grid = $serviceLocator->get('ZfcDatagrid\\Datagrid');
     $em = $serviceLocator->get(EntityManager::class);
     $userAliasDql = 'u';
     $qb = $em->getRepository($entityClass)->createQueryBuilder($userAliasDql);
     $grid->setTitle('Users');
     $columnCollection = new ColumnCollection();
     $buttonCollection = new ButtonCollection();
     $colId = new Column\Select('id', $userAliasDql);
     $colId->setLabel('User ID');
     $colId->setWidth(1);
     $columnCollection->put(ColumnCollection::$ID_COLUMN_ID, $colId);
     $colUsername = new Column\Select('username', $userAliasDql);
     $colUsername->setLabel('Username');
     $columnCollection->put(ColumnCollection::$ID_COLUMN_USERNAME, $colUsername);
     $colEmail = new Column\Select('email', $userAliasDql);
     $colEmail->setLabel('Email');
     $columnCollection->put(ColumnCollection::$ID_COLUMN_EMAIL, $colEmail);
     $actions = new Column\Action();
     $actions->setLabel('#Action');
     $actions->setWidth(3);
     $columnCollection->put(ColumnCollection::$ID_COLUMN_ACTIONS, $actions, -1000);
     $editBtn = new Column\Action\Button();
     $editBtn->setLabel('Edit');
     $editBtn->setAttribute('class', 'btn btn-primary btn-sm');
     $editBtn->setLink($this->url()->fromRoute('zfcadmin/zfcuseradmin/edit', array('userId' => $editBtn->getColumnValuePlaceholder($colId))));
     $buttonCollection->put(ButtonCollection::$ID_EDIT_BTN, $editBtn);
     $deleteBtn = new Column\Action\Button();
     $deleteBtn->setLabel('Delete');
     $deleteBtn->setAttribute('class', 'btn btn-danger btn-sm delete-btn');
     $deleteBtn->setLink($this->url()->fromRoute('zfcadmin/zfcuseradmin/remove', array('userId' => $deleteBtn->getColumnValuePlaceholder($colId))));
     $buttonCollection->put(ButtonCollection::$ID_DELETE_BTN, $deleteBtn);
     $events = $this->createPrivateEventManager(ListEvent::class);
     $events->trigger(ListEvent::$EVENT_NAME, $this, array('queryBuilder' => $qb, 'buttonCollection' => $buttonCollection, 'columnCollection' => $columnCollection, 'userAliasDql' => $userAliasDql));
     foreach ($buttonCollection->getIterator() as $btn) {
         $actions->addAction($btn);
     }
     foreach ($columnCollection->getIterator() as $column) {
         $grid->addColumn($column);
     }
     //$grid->addColumn($actions);
     $grid->setDataSource($qb);
     // Finalizing
     $grid->setToolbarTemplateVariables(array('addUrl' => $this->url()->fromRoute('zfcadmin/zfcuseradmin/create')));
     return $grid->getResponse();
 }