Created
November 1, 2016 07:50
-
-
Save gcheshkov/b3b82b785a5f20b362481e523fee435a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserAdmin extends BaseAdmin { | |
renderTableRow(props) { | |
return ( | |
<Row> | |
<CheckboxCell> | |
<TextCell value={props.object.email}> | |
<TextCell value={props.object.gender}> | |
</Row> | |
) | |
} | |
renderFieldSets(props) { | |
return ( | |
<Fieldset> | |
<EmailInput label='Емейл' value={props.object.email} error={props.errors.email}> | |
<SelectInput label='Пол' value={props.object.gender} error={props.errors.gender}> | |
<Choice label="Мэ" value="MALE"/> | |
<Choice label="Жо" value="FEMALE"/> | |
</Select> | |
</Fieldset> | |
) | |
} | |
async getObjectList(page=1) { | |
return fetch(`/users/?page=${page}`) | |
} | |
async getObject(key) { | |
return fetch(`/users/${key}/`) | |
} | |
async updateObject(key, obj) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment