我尝试仅使用 EJ2 Grid Syncfusion 在编辑模式下禁用列 列代码
columns: [
{ type: 'checkbox', field: 'CheckBox', width: 50 },
{ field: 'id', isPrimaryKey: true, visible: false, headerText: 'id', textAlign: 'Right', width: 120, type: 'number' },
{
field: 'modulID', headerText: 'Nama Modul', width: 80, validationRules: { required: true }, allowEditing :false ,
foreignKeyField: 'id', foreignKeyValue: 'modulName', dataSource: modulComplete
},
{
field: 'departmentID', headerText: 'Department', width: 80, validationRules: { required: false },
foreignKeyField: 'id', foreignKeyValue: 'departmentName', dataSource: department
},
{
field: 'pegawaiApprover1ID', headerText: 'Pegawai Approver 1', width: 80, validationRules: { required: false },
foreignKeyField: 'id', foreignKeyValue: 'nama', dataSource: pegawai
},
{
field: 'pegawaiApprover2ID', headerText: 'Pegawai Approver 2', width: 80, validationRules: { required: false },
foreignKeyField: 'id', foreignKeyValue: 'nama', dataSource: pegawai
},
{ field: 'officePerusahaanID', visible: false, headerText: 'officeid', textAlign: 'Right', width: 120, type: 'number' },
{ field: 'isApprovedByApprover', width: 40, headerText: 'isApprovedByApprover', type: 'checkbox' },
{ field: 'isApprovedByGA', width: 40, headerText: 'isApprovedByGA', type: 'checkbox' },
{ field: 'isApprovedByCheckin', width: 40, headerText: 'isApprovedByCheckin', type: 'checkbox' },
],
但是它也会禁用该列的添加操作
任何信息如何仅在编辑模式下禁用列?
谢谢。
答案 0 :(得分:0)
我们已经分析了您的查询,您可以通过启用网格的isIdentity列属性来满足您的要求。请在下面找到代码段,
columns: [
{ type: 'checkbox', field: 'CheckBox', width: 50 },
{ field: 'id', isPrimaryKey: true, visible: false, headerText: 'id', textAlign: 'Right', width: 120, type: 'number' },
{
field: 'modulID', headerText: 'Nama Modul', width: 80, validationRules: { required: true }, allowEditing :false , isIdentity: true,
foreignKeyField: 'id', foreignKeyValue: 'modulName', dataSource: modulComplete
},
],
如果您需要进一步的帮助,请与我们联系。
此致
哈里哈兰