GridCraft.WebView

The web view that displays the grid. Users won’t interact with this module directly, but it is used by the GridCraft module. We consider this an internal module and provide no stability guarantees between minor versions.

API Overview #

API Documentation #

Constants #

css #

SignatureGridCraft.WebView.css
TypeConstant
Description

The CSS for the web view

js #

SignatureGridCraft.WebView.js
TypeConstant
Description

The JavaScript for the web view

Functions #

itemTableHtml #

SignatureGridCraft.WebView.itemTableHtml(table) -> string
TypeFunction
Description

Generates an HTML table from a list of items.

Parameters
  • actionTable - A table of rows, each of which is a table of actions.
Returns
  • string containing the HTML for the item table

webViewHtml #

SignatureGridCraft.WebView.webViewHtml(string, string) -> string
TypeFunction
Description

Generates the complete HTML for a web view, including the title, CSS, JS, and item table.

Parameters
  • title - The title of the web view
  • itemTable - The HTML table generated from the actionTable
  • config - A GridCraft.Configuration object containing the configuration for the grid
Returns
  • string containing the complete HTML for the web view

configuredScreen #

SignatureGridCraft.WebView.configuredScreen(config) -> hs.screen object
TypeFunction
Description

Returns the screen that is configured for the web view.

Parameters
  • config - (table) A GridCraft.Configuration object containing the configuration for the grid
Returns
  • The configured screen object, or the primary screen if no specific configuration is set or if any screen is not found.

resizeCenter #

SignatureGridCraft.WebView.resizeCenter(hs.webview.object, [number], [number]) -> hs.webview.object
TypeFunction
Description

Resizes and centers a web view on the main screen.

Parameters
  • wv - The web view to resize and center
  • config - (table) A GridCraft.Configuration object
Returns
  • The resized and centered web view

Constructors #

webView #

SignatureGridCraft.WebView.webView(string, table, number, number) -> hs.webview object
TypeConstructor
Description

Creates a new web view intended for modal messages.

Parameters
  • title - (string) The title of the web view
  • items - (table) A list of rows, each of which is a table of actions.
  • config - (table) A GridCraft.Configuration object
Returns
  • A hs.webview object