hello @johnny
after i update gc enterprice to the latest version my second grid on multiple grids mode are not showing up
this is my code
public function kinerja($extra)
{
$crud = $this->general->_getGroceryCrudEnterprise();
$crud->setApiUrlPath(route('sdm.tr_kinerja_utama'));
$outputAll = $crud->render();
$js_files = $outputAll->js_files;
$output = $outputAll->output;
$crud2 = $this->general->_getGroceryCrudEnterprise();
$crud2->setApiUrlPath(route('sdm.tr_kinerja_penunjang'));
$output2 = $crud2->render();
$output .= '<br/><br>' . $output2->output;
$outputAll->output = $output;
$extra['jsExtra'] = view('plugins.emodal')->render() . view('plugins.datepicker')->render();
return $this->general->_showOutput($outputAll, null, @$extra);
}
public function tr_kinerja_utama($extra)
{
$rolesUser = $this->general->rolesUser();
$crud = $this->general->_getGroceryCrudEnterprise();
$crud->setTable('sdm_mst_kinerja');
$crud->setSubject('Kinerja Utama', 'Kinerja Utama');
$crud->displayAs('user_id', 'Pegawai');
$crud->fieldType('created_at', 'invisible');
$crud->columns(['rencana_kinerja', 'tahun', 'user_id']);
$crud->setConfig('max_action_buttons', ['mobile' => 1,'desktop' => 3]);
$crud->setActionButton('Target', 'fa fa-database', function ($row) {
return "javascript:emodalIframe('Target Kinerja','" . route('sdm.target_kinerja', ['kinerja_id' => $row->id]) . "',false)";
}, false);
$crud->callbackAddField('tahun', function ($fieldType, $fieldName) {
return '<input class="form-control yearpicker" name="' . $fieldName . '" type="text" value="">';
});
$crud->callbackEditField('tahun', function ($fieldValue, $primaryKeyValue, $rowData) {
return '<input class="form-control yearpicker" name="tahun" value="' . $fieldValue . '" />';
});
$crud->setMasterDetail(route('sdm.target_kinerja_view'));
if (in_array(1, $rolesUser)) { //artinya dia superadmin
$crud->setrelation('user_id', 'users', 'name');
$crud->columns(['jenis', 'rencana_kinerja', 'tahun', 'user_id']);
} else {
$crud->columns(['jenis', 'rencana_kinerja', 'tahun']);
$crud->where('sdm_mst_kinerja.user_id', Auth::user()->id);
$crud->fieldType('user_id', 'hidden');
$crud->fieldType('jenis', 'hidden');
$crud->fieldType('kinerja_penunjang_id', 'hidden');
$crud->callbackAddForm(function ($data) {
$data['kinerja_penunjang_id'] = '0';
$data['jenis'] = 'Utama';
$data['user_id'] = Auth::user()->id;
return $data;
});
$crud->where(['user_id' => Auth::user()->id]);
}
$crud->where(['jenis' => 'Utama']);
$output = $crud->render();
return $this->general->_showOutput($output, null, @$extra);
}
public function tr_kinerja_penunjang($extra)
{
$rolesUser = $this->general->rolesUser();
$crud = $this->general->_getGroceryCrudEnterprise();
$crud->setTable('sdm_mst_kinerja');
$crud->setSubject('Kinerja penunjang', 'Kinerja penunjang');
$crud->displayAs('user_id', 'Pegawai');
$crud->fieldType('created_at', 'invisible');
$crud->setConfig('max_action_buttons', ['mobile' => 1,'desktop' => 3]);
$crud->setActionButton('Target', 'fa fa-database', function ($row) {
return "javascript:emodalIframe('Target Kinerja','" . route('sdm.target_kinerja', ['kinerja_id' => $row->id]) . "',false)";
}, false);
$crud->callbackAddField('tahun', function ($fieldType, $fieldName) {
return '<input class="form-control yearpicker" name="' . $fieldName . '" type="text" value="">';
});
$crud->callbackEditField('tahun', function ($fieldValue, $primaryKeyValue, $rowData) {
return '<input class="form-control yearpicker" name="tahun" value="' . $fieldValue . '" />';
});
$crud->setMasterDetail(route('sdm.target_kinerja_view'));
if (in_array(1, $rolesUser)) { //artinya dia superadmin
$crud->setrelation('user_id', 'users', 'name');
$crud->columns(['jenis', 'kinerja_penunjang_id', 'tahun', 'user_id']);
} else {
$crud->columns(['jenis', 'kinerja_penunjang_id', 'tahun']);
$crud->where('sdm_mst_kinerja.user_id', Auth::user()->id);
$crud->fieldType('user_id', 'hidden');
$crud->fieldType('jenis', 'hidden');
$crud->fieldType('rencana_kinerja', 'hidden');
$crud->setRelation('kinerja_penunjang_id', 'sdm_mst_kinerja_penunjang', '{nama} [{nilai}]', ['is_active' => 'Ya']);
$crud->callbackAddForm(function ($data) {
// $data['kinerja_penunjang_id'] = '0';
$data['jenis'] = 'Penunjang';
$data['user_id'] = Auth::user()->id;
return $data;
});
$crud->displayAs('kinerja_penunjang_id', 'Rencana Kinerja');
$crud->where(['user_id' => Auth::user()->id]);
}
$crud->where(['jenis' => 'Penunjang']);
$output = $crud->render();
return $this->general->_showOutput($output, null, @$extra);
}
regards
Nasrul