backbone-daybed
Generic wrappers around Backbone-Forms for Daybed.
Basically, it gives you :
- Some Backbone models for Daybed concepts
- A simple form View to create and edit Daybed model records
- A helper to embed a Daybed form with one line of code
- A basic list view (table) for Daybed records
Have a look at the Demo !
Dependencies
(very) Basic Example
Load Javascript dependencies :
Initalize form in <div>
container :
DaybedSETTINGSSERVER = "http://daybed.lolnet.org"; // no trailing slash var form = Daybed; form
API
Daybed.Definition
Daybed model definition.
var definition = id: 'gnah'; definition; definition;
Methods
-
whenReady(function)
Callback function when Definition is ready (i.e. fetched from the server).
-
fieldsNames()
Returns list of fields names (
Array<String>
). -
itemSchema()
Returns the Backbone-Forms schema for editing and saving records for this model.
Daybed.ItemList
Retrieve data item of Daybed model
var definition = id: 'gnah' collection = definition; definition;collection; // (will wait if necessary)
Daybed.TableView
Shows Daybed records in a table.
Uses Definition fields names for table headers.
var collection = definition tableView = collection; definition;definition;
Daybed.FormView
A form for creating and editing Daybed records.
var formView = definition: definition; definition;definition; formView;
Options
TODO
Methods
TODO