Hello, so i have grid with many column, and there are a template to generate link, and when i click add the column is showing, which is that column is useless in add menu and edit menu, so i want to hide it
Code
var grid = new ej.grids.Grid({
dataSource: data,
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
mode: 'Dialog',
showConfirmDialog: true,
showDeleteConfirmDialog: true,
},
allowPaging: false,
allowExcelExport: true,
allowPdfExport: true,
toolbar: ['Add', 'Edit', 'Delete', 'ExcelExport', 'PdfExport'],
height: 500,
columns: [
{ field: 'detail', width: 140, headerText: 'Details', type: 'string', template: '#details' },
{ field: 'id', isPrimaryKey: true, visible: false, headerText: 'id', textAlign: 'Right', width: 120, type: 'number' },
{ field: 'nik', width: 140, headerText: 'NIK', type: 'string' },
{ field: 'nama', width: 140, headerText: 'Nama', type: 'string' },
{ field: 'email', width: 140, headerText: 'Email', type: 'string' },
{ field: 'nomorHp', width: 140, headerText: 'No HP', type: 'string' },
//{ field: 'officePerusahaanId', width: 140, headerText: 'Office', type: 'string' },
{
field: 'jenisKelamin', width: 140, headerText: 'Jenis Kelamin', type: 'string', validationRules: { required: true },
foreignKeyField: 'jenisKelamin', foreignKeyValue: 'value', dataSource: jenkel
},
{ field: 'tanggalLahir', width: 140, headerText: 'Tanggal Lahir', type: 'string', editType: 'datepickeredit', format: { skeleton: 'yMMMEd', type: 'date' }, validationRules: { required: true } },
{ field: 'pendidikan', width: 140, headerText: 'Pendidikan', type: 'string' },
{ field: 'universitas', width: 140, headerText: 'Universitas', type: 'string' },
{ field: 'statusPernikahan', width: 140, headerText: 'Status Pernikahan', type: 'string' },
{ field: 'jumlahAnak', width: 140, headerText: 'Jumlah Anak', type: 'string' },
{ field: 'alamatTingal', width: 140, headerText: 'Alamat Tinggal', type: 'string' },
{ field: 'agama', width: 140, headerText: 'Agama', type: 'string' },
{ field: 'kesehatan', width: 140, headerText: 'Kesehatan', type: 'string' },
{ field: 'ukuranPakaian', width: 140, headerText: 'Ukuran Pakaian', type: 'string' },
{ field: 'ukuranSepatu', width: 140, headerText: 'ukuranSepatu', type: 'string' },
{
field: 'officePerusahaanId', headerText: 'Office', width: 80, validationRules: { required: true },
foreignKeyField: 'id', foreignKeyValue: 'namaOffice', dataSource: office
},
{
field: 'jabatanId', headerText: 'Jabatan', width: 80, validationRules: { required: true },
foreignKeyField: 'id', foreignKeyValue: 'jabatanName', dataSource: jabatan
},
{
field: 'departmentId', headerText: 'Departemen', width: 80, validationRules: { required: true },
foreignKeyField: 'id', foreignKeyValue: 'departmentName', dataSource: departemen
},
{ field: 'cabang', width: 140, headerText: 'Cabang', type: 'string' },
{ field: 'golongan', width: 140, headerText: 'Golongan', type: 'string' },
{ field: 'statusKepegawaian', width: 140, headerText: 'Status Kepegawaian', type: 'string' },
{ field: 'tahunCuti', width: 140, headerText: 'Tahun Cuti', type: 'string' },
{ field: 'jatahCuti', width: 140, headerText: 'Jatah Cuti', type: 'string' },
{ field: 'cutiTerpakai', width: 140, headerText: 'Cuti Terpakai', type: 'string' },
{ field: 'cutiSisa', width: 140, headerText: 'Sisa Cuti', type: 'string' },
{ field: 'isActivated', width: 140, headerText: 'Activate', displayAsCheckBox: true, type: 'boolean', editType: "booleanedit" },
{ field: 'isApprover', width: 140, headerText: 'Approver', displayAsCheckBox: true, type: 'boolean', editType: "booleanedit" },
{ field: 'isMasuk', width: 140, headerText: 'Masuk', displayAsCheckBox: true, type: 'boolean', editType: "booleanedit" },
{ field: 'kodeAktivasi', width: 140, headerText: 'Kode', type: 'string' },
{ field: 'udid', width: 140, headerText: 'UDID', type: 'string' },
{ field: 'jamMasukDefault', width: 140, headerText: 'Jam Masuk Default', type: 'string', validationRules: { required: true } },
{ field: 'jamPulangDefault', width: 140, headerText: 'Jam Pulang Default', type: 'string', validationRules: { required: true } },
{ field: 'isEastTimeZone', width: 140, headerText: 'East Time Zone', displayAsCheckBox: true, type: 'boolean', editType: "booleanedit" },
],
actionComplete: function (args) {
if (args.requestType == "add") {
var drpdwn = this.getContentTable("#Grid").find("#detailGridNik").ejDropDownList("instance");
console.log(drpdwn);
drpdwn.setSelectedValue(2);
}
}
});
grid.appendTo('#Grid');
The column that i mean is details
Please help me, thx you