↕️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
)
Last updated