my schema and uischema is :
const schema = {
type: 'object',
properties: {
is_external_person: {
type: 'string'
},
committee_emp: {
type: 'string',
title: 'ชื่อกรรมการ'
},
committee_name: {
type: 'string',
title: 'ชื่อกรรมการ'
},
committee_position: {
type: 'string',
title: 'ตำแหน่ง'
}
},
required: ['committee_emp', 'committee_name', 'committee_position']
}
const uischema = {
type: 'VerticalLayout',
elements: [
{
type: 'Control',
scope: '#/properties/is_external_person',
options: {
label: 'ประเภทบุคลากร',
size: { xs: 12, md: 8 },
fieldType: 'radio',
enum: [
{ value: '0', label: 'บุคลากรภายใน' },
{ value: '1', label: 'บุคลากรภายนอก' }
]
}
},
{
type: 'Control',
scope: '#',
options: { divider: true }
},
{
type: 'Group',
label: 'ข้อมูลทั่วไป',
marginTop: '0px',
marginBottom: '10',
elements: [
{
type: 'Control',
scope: '#/properties/committee_emp',
options: {
size: { xs: 12, md: 6 },
fieldType: 'autocomplete',
doctype: 'Employee',
fieldValue: 'first_name',
fieldLabel: 'first_name',
placeholder: 'ค้นหาคณะกรรมการ',
searchIcon: true
}
},
{
type: 'Control',
scope: '#/properties/committee_name',
options: {
size: { xs: 12, md: 6 },
fieldType: 'text',
placeholder: 'ระบุชื่อกรรมการ'
},
rule: {
effect: 'SHOW',
condition: {
scope: '#/properties/is_external_person',
schema: { const: '1' }
}
}
},
{
type: 'Control',
scope: '#/properties/committee_position',
options: {
size: { xs: 12, md: 6 },
fieldType: 'text',
placeholder: 'ระบุตำแหน่ง'
}
}
]
}
]
}
so when i switch the is_external_person the rule is not working how to fix it ?
my dependencies :
“@jsonforms/core”: “^3.5.1”,
“@jsonforms/examples”: “^3.5.1”,
“@jsonforms/material-renderers”: “^3.5.1”,
“@jsonforms/react”: “^3.5.1”,