2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00
This commit is contained in:
Rushabh Mehta 2018-01-10 18:27:24 +05:30
parent ec96f02f52
commit 9ae2b84805
2 changed files with 12 additions and 13 deletions

View File

@ -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);
});
```

View File

@ -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)