QuickDEV
  • ▶️Quick start
    • 🔃Overview
    • 🔑Security
  • 🎭Users management
    • 👨‍👩‍👦‍👦Members and groups
    • 🔐Permission for resources
  • 🖥️Applications
    • ➕Create applications
      • ⤴️Create application/module
      • 🔲Module
      • ✅Version and Release Management
    • 🎨Application editor
      • 👁️‍🗨️Visual components
        • ⚙️Common component settings
        • ⬆️File upload
        • 📊Charts and graphs
        • 🌄Image
        • 📋Option lists
        • 📑List view
        • ⬜Drawer
        • 🗺️Google maps
        • 📩Messages / Toast
        • 📅Calendar
        • Custom component
      • #️⃣Use markdown
      • ⌨️Keyboard shortcuts
    • 🔗Navigation
    • ⏯️Actions editor
      • ⏱️Date handling
      • 🟰Data selection & JavaScript
      • ⚡Event handlers
      • 🔎JavaScript Query
      • ✖️Dynamic variable
      • 💱Transformers
      • 🧮Data responder
      • ↕️Built-in JS functions
      • 📚Third-party libraries
    • 🖌️Styling
      • 📝Themes
      • 🖍️Customize styles
  • 🚀Database & API
    • 🔎Queries
    • 🧰Query repository
    • 📡Datasources
      • 🌎API
        • 1️REST API
        • 2️GraphQL
        • 3️Google Sheets
      • 🟠SQL Databases
        • 1️Oracle
        • 2️Microsoft SQL Server
        • 3️MySQL
        • 4️PostgreSQL
        • 5️MariaDB
      • 🟡NoSQL Databases
        • 1️MongoDB
        • 2️CouchDB
        • 3️DynamoDB
      • 🔴REDIS
      • 🟢BigData & OLAP
        • 1️Big Query
        • 2️Snowflake
        • 3️ClickHouse
        • 4️Elasticsearch
      • 🌐WebSocket
  • 💻Integrations
    • 1️ANGULAR
    • 2️HTML Pages
Powered by GitBook
On this page
  • Helpers
  • Open URL
  • Open application
  • Download file
  • Copy to clipboard
  • Message - global notification
  • localStorage
  • Responsiveness / Screen information
  1. Applications
  2. Actions editor

Built-in JS functions

Helpers

Open URL

helpers.openUrl(url: string, options?: { newTab:  boolean = true })
// Example:
helpers.openUrl("https://www.google.com", { newTab: true })

Open application

helpers.openApp( applicationId: string, options?: { queryParams?: {"key":"value"}, hashParams?: {"key":"value"}, newTab: true } )

//Open an QuickDEV app in a new tab
helpers.openApp("632bddc33bb9722fb561f6c0", { newTab: true })

//Open an QuickDEV app and pass in `id` parameter
helpers.openApp("632bddc33bb9722fb561f6c0", { queryParams: { "id": table1.selectedRow.id } })
//or
helpers.openApp("632bddc33bb9722fb561f6c0", { hashParams: { "id": table1.selectedRow.id } })

Download file

helpers.downloadFile(data: any, fileName: string, options?: { fileType?: string, dataType?: "url" | "base64" } )

// Download the base64 data from a file component as a PNG file named users-data.
helpers.downloadFile(file1.value[0], "users-data", { fileType: "png", dataType: "base64" })

// Download the results of query1 as a XLXS file named users-data.
helpers.downloadFile(query1.data, "users-data", { fileType: "xlsx" })
// or in this way:
helpers.downloadFile(query1.data, "users-data.xlsx")

// Download the results of query1 as a XLXS file named users-data.
helpers.downloadFile(restApiQuery.data, "users-data", { fileType: "pdf", dataType: "base64" })

Copy to clipboard

helpers.copyToClipboard( text: string )

//Copy input value to clipboard
helpers.copyToClipboard( input1.value )

Message - global notification

Use message methods to send a global alert notification, which displays at the top of the screen and lasts for 3 seconds by default. Each of the following four methods supports a unique display style.

message.success("Query runs successfully", { duration: 5 })
message.info("Please confirm your information", { duration: 7 })
message.warn("Warning", { duration: 4 })
message.error("Query runs with error", { duration: 10 })

localStorage

Use the localStorage capabilities to store and control key-value pairs. This information persists even after application refreshes and can be used in any application via localStorage.values

//setItem:
localStorage.setItem(key: string, value: any)
localStorage.setItem("employeeName", 'QuickDEV')

//use localStorage values
localStorage.values['employeeName'] -> QuickDEV

// removeItem:
localStorage.removeItem(key: string)
localStorage.removeItem("employeeName")

//clear
localStorage.clear()

Responsiveness / Screen information

To enable responsive Layouts, you need to know which device type your app is currently viewed. This helper gives you information about the screen sizes. The values automatically update on Screen size changes.

You can use deviceType to get the Type of the Device based on the current screen width of the QuickDEV app (or the website where it is embedded). This value automatically updates on Screen size changes.

The screenInfo variable provide information about used device (screenInfo.isDesktop, screenInfo.isMobile, screenInfo.isTablet) and the window size (screenInfo.width, screenInfo.height)

PreviousData responderNextThird-party libraries

Last updated 4 months ago

🖥️
⏯️
↕️