Avails facility to list
/create
/update
/delete
records for submaster
- Available props are mentioned in data-formats
import { Provider, SubMaster } from '@knovator/masters-admin`;
function App() {
return (
<Provider
...
>
<SubMaster />
</Provider>
)
}
- Avails facility to show
Table
component for Master explicitly. - Available props are mentioned in data-formats
<SubMaster>
<SubMaster.Table />
</SubMaster>
- Avails facility to show
Pagination
component for Master explicitly.
<SubMaster>
<SubMaster.Table />
<SubMaster.Pagination />
</SubMaster>
- Avails facility to show
Search
component for Master explicitly. - Search records in master, as user starts typing
<SubMaster>
<SubMaster.Search />
</SubMaster.Search>
- Avails facility to open
Form
, when clicked
<SubMaster>
<SubMaster.AddButton />
</SubMaster.Search>
- Avails facility to access form parameters, to use when
explicitForm
is true forMaster
<Master
explicitForm={true}
>
<SubMaster.FormWrapper>
{({ formState, onClose, open }) => (
...
)}
</SubMaster.FormWrapper>
</SubMaster>
- Possible form-states are mentioned in data-formats
- Avails facility to show
FormActions
, to be used insideFormWrapper
along withForm
. Required to provideformRef
.
const formRef = React.createRef();
// return
<Master
explicitForm={true}
>
<SubMaster.FormWrapper>
{({ formState, onClose, open }) => (
<>
<SubMaster.Form ref={formRef} />
<SubMaster.FormActions formRef={formRef} />
</>
)}
</SubMaster.FormWrapper>
</SubMaster>
- Avails facility to show
Form
, to be used insideFormWrapper
along withFormActions
. Required to provideref
.
const formRef = React.createRef();
// return
<Master
explicitForm={true}
>
<SubMaster.FormWrapper>
{({ formState, onClose, open }) => (
<>
<SubMaster.Form ref={formRef} />
<SubMaster.FormActions formRef={formRef} />
</>
)}
</SubMaster.FormWrapper>
</SubMaster>