2
0
mirror of https://github.com/frappe/books.git synced 2025-02-08 23:18:31 +00:00
books/frappe/docs/lists.md
Rushabh Mehta 0fa2c70133 docs
2018-01-10 18:19:52 +05:30

659 B

Lists

A list object handles object listing and paging, for a standard model.

Example

const Page = require('frappe-core/frappe/client/view/page').Page;
const ListView = require('frappe-core/frappe/client/view/list').ListView;

// create a new page
let todo_list = new Page('ToDo List');

// init a new list
todo_list.list = new ListView({
	doctype: 'ToDo',
	parent: this.todo_list.body
});

todo_list.on('show', () => {
	// refresh on show
	todo_list.list.run();
})

Creating a new List

You can create a new list object by passing the DocType and the parent element of the list

Refreshing

To reload the list, call the run method