Hi @johnny
I am trying to show limited values in dropdown on Edit based on certain condition. It is not working as per expectation. Can you please review following code.
It just displays blank drop down.
$cardsKeyValArray = array();
if ($crud->getState() === 'EditForm') {
$stateInfo = $crud->getStateInfo();
$detailsId = $stateInfo->primaryKeyValue;
$entryDetails = $this->model->getCurrentEntry($detailsId);
$cardModel = new \App\Models\CardModel;
$cardsData = $cardModel->fetchCardsByDepartment($entryDetails[0]['depart_id']);
foreach($cardsData as $card) {
$cardsKeyValArray[$card['card_id']] = $card['card_short_name'];
}
}
$crud->fieldTypeEditForm('card_id', 'dropdown', $cardsKeyValArray);