Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (27 loc) · 527 Bytes

dropdown.md

File metadata and controls

41 lines (27 loc) · 527 Bytes

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();