mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
docs
This commit is contained in:
parent
ec96f02f52
commit
9ae2b84805
@ -44,20 +44,19 @@ edit_page.on('show', async (params) => {
|
||||
To setup a form for a new document, just create a new document with the Frappe.js document helpers, and `use` it with paramter `is_new` = true
|
||||
|
||||
```js
|
||||
// setup todo new
|
||||
frappe.router.add('new/todo', async (params) => {
|
||||
// setup todo new
|
||||
frappe.router.add('new/todo', async (params) => {
|
||||
|
||||
// new document
|
||||
app.doc = await frappe.get_doc({doctype: 'ToDo'});
|
||||
// new document
|
||||
app.doc = await frappe.get_doc({doctype: 'ToDo'});
|
||||
|
||||
// set a random name
|
||||
app.doc.set_name();
|
||||
// set a random name
|
||||
app.doc.set_name();
|
||||
|
||||
// show the page
|
||||
app.edit_page.show();
|
||||
|
||||
// is_new=true
|
||||
app.edit_page.form.use(app.doc, true);
|
||||
});
|
||||
// show the page
|
||||
app.edit_page.show();
|
||||
|
||||
// is_new=true
|
||||
app.edit_page.form.use(app.doc, true);
|
||||
});
|
||||
```
|
@ -8,7 +8,7 @@ Frappe.js is a meta-data driven framework that enables rapid application develop
|
||||
- [Declaring Models](models.md)
|
||||
- [Controllers](controllers.md)
|
||||
- [Metadata](metadata.md)
|
||||
- [Managing Documents](documents.md)
|
||||
- [Managing Documents](document.md)
|
||||
- [Server](server.md)
|
||||
- [REST API](rest.md)
|
||||
- [Client](client.md)
|
||||
|
Loading…
Reference in New Issue
Block a user