Flower Docs
  • OpenFlower overview
    • The "Hello World" tutorial
  • Videos
    • OpenFlower in 100 seconds
  • 🆕Setup and run
    • Cloud & Private Cloud
    • Self-hosting
      • Access local database or API
      • Google Cloud Platform
      • Heroku
      • Migration from Openblocks
      • Update MongoDB Versions
      • OpenFlower Version Update
      • Traefik loadbalancer
      • SMTP Server
    • Security
  • 🏨Workspaces & Teamwork
    • Workspaces
    • Members and Groups
    • Permissions for Resources
    • OAuth
      • KeyCloak
      • Google
      • GitHub
      • Generic OAuth Provider
    • Query library
    • OpenFlower Marketplace
  • ✨Build Applications
    • Create a new App
      • Modules
      • Version and Release Management
    • App Editor
      • Visual Components
        • Common Component Settings
        • File upload
        • Charts and graphs
        • Image
        • Option lists
        • List View
        • Drawer
        • Google Maps
        • Table
        • Messages / Toast
        • Calendar
      • Date handling
      • Bulk Editing
      • Layers
      • Data selection & Javascript
      • Use Markdown
      • Keyboard shortcuts
    • App Navigation
    • App Interaction
      • Event handlers
    • Themes & Styling
      • Design an efficient and user-friendly form
      • Customize Styles
      • Component Styling Possibilities
  • 🚀Connect your Data
    • Data source basics
    • Data sources in OpenFlower
      • APIs as Datasource
        • REST API
        • GraphQL
        • Google Sheets
      • SQL Databases
        • MySQL
        • MariaDB
        • PostgreSQL
        • Microsoft SQL Server
        • Oracle
      • NoSQL Databases
        • MongoDB
        • CouchDB
        • DynamoDB
      • InMemory Databases
        • Redis
      • File Storages
        • S3 File Storage
      • BigData & OLAP
        • Big Query
        • Snowflake
        • ClickHouse
        • Elasticsearch
      • Websocket Datasource
    • Query basics
      • Bind Query Data to Components
      • Query library
  • 🪄Workflows
    • n8n Integration
  • 💫Business Logic in Apps
    • Write JavaScript
      • JavaScript query
      • Temporary state
      • Transformers
      • Data responder
      • Built-in JS functions
  • 🙌Publish Apps
    • Share an App
    • Publish an App
    • Embedd an App
      • Embed Apps in React
      • Native embed SDK
        • Build the SDK from Source
  • 🔥OpenFlower Extension
    • Opensource Contribution
      • Develop UI components for Apps
      • Develop Data Source Plugins
    • Use third-party libraries in Apps
      • Day.js Date handling
      • Import your own JavaScript Library
    • Custom component
    • OpenFlower Open REST API
Powered by GitBook
On this page
  • Layout
  • Position
  • Resize
  • Events
  • Trigger openDrawer
  • Trigger closeDrawer
  1. Build Applications
  2. App Editor
  3. Visual Components

Drawer

In OpenFlower, Drawer is an overlay sidebar to display information or perform operations, without interrupting the workflow on the main window.

The following example builds a shopping cart using a drawer.

Layout

When inserted by drag-and-drop operation, a Drawer floats on the right side (by default) of the main window. Then, you can add components onto the Drawer according to your needs. In the editing mode of a Drawer, other components on the canvas are not editable.

When a drawer is closed, you can re-open it by clicking the corresponding label in the Modals tab in the left pane.

Position

In the Properties tab, you can set the position of the drawer. The default position is the right side of the main window.

Resize

In Properties tab, you can set the width of the drawer by pixels or percentage. Note that the height of a drawer is the same as the main window and is not customizable.

Events

You can reference a drawer in JS code anywhere in your app or call it through a "control component" action in Properties > Interaction > Event handlers.

The following sections guide you through how to open and close a drawer by clicking a button in an online shopping app.

Trigger openDrawer

  1. Add a button and rename it as gotoCart.

  2. Set the event handler of the button. Select "Control component" as the Action and select the component "cart" and method "openDrawer". All these settings are auto-saved.

  3. Click the button gotoCart and the binded drawer "cart" is open.

Trigger closeDrawer

Triggerring "closeDrawer" is similar to triggering "openDrawer". When setting up the event handler, select the method "closeDrawer". For example, in the [Online Shopping demo]todo), closing a drawer that displays the shopping cart is implemented in the following steps.

  1. Add a button and rename it as gobackShopping.

  2. Set the event handler of the button. Select "Control component" as the Action and select the component "cart" and method "closeDrawer". All these settings are auto-saved.

  3. Click the "Continue Shopping" button and the binded drawer "cart" is closed.

PreviousList ViewNextGoogle Maps

Last updated 7 months ago

Usually, in an app, you trigger opening a drawer by an event such as clicking a button. For example, in the , opening a drawer to display the shopping cart is implemented in the following steps.

✨
Online Shopping demo