2
0
mirror of https://github.com/frappe/books.git synced 2024-12-26 20:30:25 +00:00
books/docs/client/ui/dropdown.md
Rushabh Mehta 328a9de7d4 💥 frappejs
2018-01-16 11:39:17 +05:30

527 B

Dropdown

Creates a Dropdown button with JS events

API

Methods

  • add_item
  • float_right
  • expand
  • collapse
  • toggle

Usage

Create

const Dropdown = require('frappejs/frappe/client/ui/dropdown');

let dropdown = new Dropdown({label:'Actions', parent:this.toolbar});

Add Item

Add a new link to the dropdown

dropdown.add_item('Delete', async () => {
	this.show_alert('Deleted', 'success');
});

Float Right

Move the element to the right

dropdown.float_right();