minvalue validation react admin
import React from 'react';
import {
TabbedForm,
FormTab,
Edit,
Datagrid,
TextField,
DateField,
TextInput,
ReferenceManyField,
NumberInput,
DateInput,
BooleanInput,
EditButton
} from 'react-admin';
export const PostEdit = (props) => (
<Edit {...props}>
<TabbedForm>
<FormTab label="summary">
<TextInput disabled label="Id" source="id" />
<TextInput source="title" validate={required()} />
<TextInput multiline source="teaser" validate={required()} />
</FormTab>
<FormTab label="body">
<RichTextInput source="body" validate={required()} addLabel={false} />
</FormTab>
<FormTab label="Miscellaneous">
<TextInput label="Password (if protected post)" source="password" type="password" />
<DateInput label="Publication date" source="published_at" />
<NumberInput source="average_note" validate={[ number(), minValue(0) ]} />
<BooleanInput label="Allow comments?" source="commentable" defaultValue />
<TextInput disabled label="Nb views" source="views" />
</FormTab>
<FormTab label="comments">
<ReferenceManyField reference="comments" target="post_id" addLabel={false}>
<Datagrid>
<TextField source="body" />
<DateField source="created_at" />
<EditButton />
</Datagrid>
</ReferenceManyField>
</FormTab>
</TabbedForm>
</Edit>
);
Also in JavaScript:
- moment.js
- check date clash js
- js reverse number
- how to connect react to backend
- defineCall is not a function at Sequelize.import sequelize.js
- javascript create array of objects from multiple arrays
- check scroll top height in react js
- js keyframe
- microservices architecture node
- how to use props in functional component in react
- minify css package.json
- add firebase in react
- microsoft jscript runtime error 800a138f
- add jquery to page
- knex pagination plugin
- jQuery check a radio button
- SyntaxError: Unexpected token '/' in C:\Users\SHUBHAM KUNWAR\Desktop\login\views\register.ejs while compiling ejs
- multithreading in javascript
- string includes substring javascript
- testing a function in jest on click react
- Javascript modify URL without reload
- foreach db mongodb
- jest mock implementation
- remove underline from hyperlink react