Thanks for your response @sdirix , I did update all the packages to the latest version. readonly options is working now.
But still I’m facing issue with Group Custom layout readonly options.
I have created custom layout for “Group” type, When I add the option readonly:true, it is not becoming effective in this custom layout, means fields inside this group custom layout not becoming disabled, even though I have added <MaterialLayoutRenderer {…layoutProps} />.
Below is my custom layout renderer code. I have added this in jsonforms renderer’s list, I could collapse the Group section, but readonly options is not working,
With default Group renderer, readonly options is working fine.
import React from ‘react’;
import { rankWith, RendererProps, uiTypeIs } from ‘@jsonforms/core’;
import {
MaterialLayoutRenderer,
MaterialLayoutRendererProps,
} from ‘@jsonforms/material-renderers’;
import { withJsonFormsLayoutProps } from ‘@jsonforms/react’;
import { ExpandMore } from ‘@mui/icons-material’;
import {
Accordion,
AccordionDetails,
AccordionSummary,
Typography,
} from ‘@mui/material’;
interface MyGroupRendererProps extends RendererProps {
uischema: any;
// Replace ‘any’ with the appropriate type for your uischema
}
const MyGroupRenderer: React.FC = (props) => {
const { path, visible, renderers, schema, uischema } = props;
const layoutProps: MaterialLayoutRendererProps = {
elements: uischema.elements,
schema: schema,
path: path,
direction: ‘column’,
visible: visible,
uischema: uischema,
renderers: renderers,
};
return (
<AccordionSummary expandIcon={}>
{uischema?.label}
<MaterialLayoutRenderer {…layoutProps} />
);
};
export const groupCollapsibleRendererRegistration = {
tester: rankWith(1000, uiTypeIs(‘Group’)),
renderer: withJsonFormsLayoutProps(MyGroupRenderer),
};
Reference: Custom Layouts - JSON Forms
Kindly let me know, whether this is the expected behavior or what else i can do to disable fields inside group custom layout renderer.
Thanks,
Suseendhiran D