Avails facility to list
/create
/update
/delete
records for master
- Available props are mentioned in data-formats
import { Provider, Master } from '@knovator/masters-admin`;
function App() {
return (
<Provider
...
>
<Master />
</Provider>
)
}
- Avails facility to show
Table
component for Master explicitly. - Available props are mentioned in data-formats
<Master>
<Master.Table />
</Master>
- Avails facility to show
Pagination
component for Master explicitly.
<Master>
<Master.Table />
<Master.Pagination />
</Master>
- Avails facility to show
Search
component for Master explicitly. - Search records in master, as user starts typing
<Master>
<Master.Search />
</Master.Search>
- Avails facility to open
Form
, when clicked
<Master>
<Master.AddButton />
</Master.Search>
- Avails facility to list
Master
records, to use together in sync withSubMaster
<Master>
<Master.Lister />
</Master>
Props
render({ row, onClick, masterCode }) => JSX
(optional) => function to render list items, provides following arguments while executionrow
=> Current recordonClick
=> Function to call when current item is selected/clickedmasterCode
=> string indicates record code currently selected
selectFirst
=> boolean prop indicats to show submasters data for first master record
- Avails facility to access form parameters, to use when
explicitForm
is true forMaster
<Master
explicitForm={true}
>
<Master.FormWrapper>
{({ formState, onClose, open }) => (
...
)}
</Master.FormWrapper>
</Master>
- 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}
>
<Master.FormWrapper>
{({ formState, onClose, open }) => (
<>
<Master.Form ref={formRef} />
<Master.FormActions formRef={formRef} />
</>
)}
</Master.FormWrapper>
</Master>
- Avails facility to show
Form
, to be used insideFormWrapper
along withFormActions
. Required to provideref
.
const formRef = React.createRef();
// return
<Master
explicitForm={true}
>
<Master.FormWrapper>
{({ formState, onClose, open }) => (
<>
<Master.Form ref={formRef} />
<Master.FormActions formRef={formRef} />
</>
)}
</Master.FormWrapper>
</Master>