This library helps you create more functional table easily.
Fiddle : https://jsfiddle.net/heruujoko/vj7ds7um/2/
Note: the fiddle is just to show how to set up the HTML tags and may not have the full table functionality since I can't provide an API to serve the table.
Include crudtable.js to your page, and just wrap it inside a div with id "crudsection"
<div id="crudsection">
<crud-table endpoint="link_to_your_api_endpoint" columns="your_column_json_spec"></crud-table>
</div>
[
{ "label": "name" , "type":"text", "required": true},
{ "label": "email" , "type":"email", "required": true},
{ "label": "password" , "type":"password", "required": true},
{ "label": "description" , "type":"textarea", "required": true},
]
Supported form type :
- text
- textarea
- password
This library assumes your API has common resources structures and match the JSON Spec for the forms
- GET http://your_endpoint/
[
{
"name": "name",
"email": "email",
"password": "password",
"description": "description"
},
{
"name": "name",
"email": "email",
"password": "password",
"description": "description"
}
]
- GET http://your_endpoint/{id}
{
"name": "name",
"email": "email",
"password": "password",
"description": "description"
}
- POST http://your_endpoint/
- PUT http://your_endpoint/{id}
{
"name": "name",
"email": "email",
"password": "password",
"description": "description"
}
- DELETE http://your_endpoint/{id}
Add select , multiselect and file options for forms.