Hello, how to change the data source if the column have foreign key?
This is my grid code
var grid = new ej.grids.Grid({
dataSource: data,
editSettings: {
allowEditing: true,
allowAdding: false,
allowDeleting: false,
mode: 'Dialog',
showConfirmDialog: true,
showDeleteConfirmDialog: true
},
allowPaging: true,
toolbarTemplate: '#toolbar-template',
height: 500,
queryCellInfo: queryCellInfo,
columns: [
{ type: 'checkbox', field: 'CheckBox', width: 100 },
{ field: 'id', isPrimaryKey: true, visible: false, headerText: 'id', textAlign: 'Right', width: 10, type: 'number' },
{ field: 'officePerusahaanId', visible: false, headerText: 'officePerusahaanId', textAlign: 'Right', width: 10, type: 'number' },
{ field: 'pegawaiId', visible: false, headerText: 'pegawaiId', textAlign: 'Right', width: 10, type: 'number' },
{ field: 'tanggalPengajuan', width: 200, headerText: 'Tanggal Pengajuan', type: 'string', editType: 'datepickeredit',format: { skeleton: 'yMMMEd', type: 'date' }, validationRules: { required: true } },
{ field: 'nik', width: 240, headerText: 'NIK', type: 'string', validationRules: { required: true } },
{ field: 'deskripsi', width: 240, headerText: 'Deskripsi', type: 'string', validationRules: { required: true } },
{ field: 'kategori', width: 140, headerText: 'Kategori', type: 'string', validationRules: { required: true } },
{ field: 'isBiasa', width: 140, headerText: 'IsBiasa', type: 'string', template: '#biasa', validationRules: { required: true } },
{ field: 'isMendesak', width: 140, headerText: 'IsMendesak', type: 'string', template: '#mendesak', validationRules: { required: true } },
{
field: 'itHelpdeskStatus', width: 140, headerText: 'ITHelpdeskStatus', type: 'string', validationRules: { required: true },
foreignKeyField: 'itHelpdeskStatus', foreignKeyValue: 'value', editType: 'dropdownedit', dataSource: [
{ itHelpdeskStatus: 1, value: 'Submitted' },
{ itHelpdeskStatus: 2, value: 'Sedang Dikerjakan' },
{ itHelpdeskStatus: 3, value: 'Selesai' }
],
},
{ field: 'recheckOK', width: 140, headerText: 'ReCheck OK', type: 'string', validationRules: { required: true } },
],
pageSettings: { pageCount: 2, pageSizes: true },
});
every time i change the data source it's like the grid.refresh() only