Skip to main content

ui

Routines for building UI

Namespaces

NamespaceDescription
cards-
css-
forms-
hintsVisual hints attached to an element. They can be used to introduce a new app to users.
input-
labels-
panels-
time-
tools-

Classes

ClassDescription
EntityMetaDartProxyOverride the corresponding methods, and register an instance to let Datagrok know how to handle objects of the specified type.
ObjectHandlerOverride the corresponding methods, and register an instance to let Datagrok know how to handle objects of the specified type.
ObjectHandlerResolutionArgs-
toolsUI Tools *
TooltipRepresents a tooltip.

Variables

VariableDescription
icons-
tooltip-

Functions

FunctionDescription
_backColorInternal helper to set background color and return the element for chaining. Prefer using CSS classes for styling.
_classInternal helper to add a CSS class and return the element for chaining. Prefer using ui.element() with className parameter or standard classList API.
_colorInternal helper to set text color and return the element for chaining. Prefer using CSS classes for styling.
_innerTextInternal helper to set element inner text and return the element for chaining. Prefer using standard DOM APIs or ui.div/ui.span with content directly.
accordionCreates an accordion with dynamically populated panes. Example: https://public.datagrok.ai/js/samples/ui/components/accordion
actionLink-
appendAllAppends multiple elements to root, and returns root. An element could be either HTMLElement or Viewer.
bigButton-
bindBinds [item] with the [element]. It enables selecting it as a current object, drag-and-drop, tooltip, and popup menu.
bindInputs-
blockExample: https://public.datagrok.ai/js/samples/ui/containers/blocks
block25Example: https://public.datagrok.ai/js/samples/ui/containers/blocks
block50Example: https://public.datagrok.ai/js/samples/ui/containers/blocks
block75Example: https://public.datagrok.ai/js/samples/ui/containers/blocks
boxExample: https://public.datagrok.ai/js/samples/ui/containers/box
boxFixed-
breadcrumbsExample: https://public.datagrok.ai/js/samples/ui/components/breadcrumbs
buttonCreates a button with the specified text, click handler, and tooltip. Example: https://public.datagrok.ai/js/samples/ui/components/buttons
buttonsInput-
canvas-
cardRenders content as a card.
colorPickerCreates a color picker bound to colorDiv: clicking the element opens the picker, and its background updates live to preview the selected color.
comboPopupCreates a combo popup with the specified icons and items. Example: https://public.datagrok.ai/js/samples/ui/components/combo-popup
comboPopupItemsCreates a combo popup with the specified icons and items
contextActions-
dialogCreates a [Dialog]. Example: https://public.datagrok.ai/js/samples/ui/containers/splitters
div-
divHDiv flex-box container that positions child elements horizontally. Example: https://public.datagrok.ai/js/samples/ui/containers/flexbox
divTextReturns DivElement with the specified inner text. Example: https://public.datagrok.ai/js/samples/ui/components/typography
divVDiv flex-box container that positions child elements vertically. Example: https://public.datagrok.ai/js/samples/ui/containers/flexbox
dropDownCreates a dropdown component. The most common use case is a menu dropdown.
elementCreates an instance of the element for the specified tag, and optionally assigns it a CSS class.
emptyRemoves all child nodes, and disposes widgets that these nodes might contain. See also [remove].
extractRoot-
fileBrowserExample: https://public.datagrok.ai/js/samples/ui/components/file-browser
form-
h1Example: https://public.datagrok.ai/js/samples/ui/components/typography
h2Example: https://public.datagrok.ai/js/samples/ui/components/typography
h3Example: https://public.datagrok.ai/js/samples/ui/components/typography
iconFAReturns a font-awesome icon with the specified name, handler, and tooltip. Example: https://public.datagrok.ai/js/samples/ui/components/icons
iconFABSame as iconFA but also blue.
iconImage-
iconSvgCreates an icon for the SVG image Usage: - iconSvg('ai.svg') would map to /images/ai.svg - iconSvg('ai') would map to the svg-ai class
iframeExample: https://public.datagrok.ai/js/samples/ui/components/iframe
imageExample: https://public.datagrok.ai/js/samples/ui/components/image
infoExample: https://public.datagrok.ai/js/samples/ui/components/info-bar
inlineTextRenders inline text, calling [renderMarkup] for each non-HTMLElement. Example: https://public.datagrok.ai/js/samples/ui/components/typography
inputs-
inputsRow-
labelExample: https://public.datagrok.ai/js/samples/ui/components/typography
linkCreates an <a> element.
listCreates a visual element representing list of [items]. Example: https://public.datagrok.ai/js/samples/ui/components/list
loaderExample: https://public.datagrok.ai/js/samples/ui/components/loading-indicators
makeDraggableExample: https://public.datagrok.ai/js/samples/ui/interactivity/drag-and-drop
makeDroppable-
markdownExample: https://public.datagrok.ai/js/samples/ui/components/markdown
narrowForm-
onSizeChangedExample: https://public.datagrok.ai/js/samples/ui/ui-events
pExample: https://public.datagrok.ai/js/samples/ui/components/typography
panelExample: https://public.datagrok.ai/js/samples/ui/containers/panels
patternsInput-
popupMenuExample: ui.popupMenu({ 'About': () => grok.shell.info('About'), 'File': { 'Open': () => grok.shell.info('Open'), 'Close': () => grok.shell.info('Close'), } });
rangeSliderExample: https://public.datagrok.ai/js/samples/ui/components/range-slider
removeRemoves the [element] from the DOM, and disposes any widgets that the [element] might contain. See also [empty].
renderRenders object to html element.
renderCardRenders object to html card.
renderInline-
ribbonPanelTypically, this is a host for the icons.
schemeInput-
setClass-
setDisabled-
setDisplay-
setDisplayAll-
setUpdateIndicatorSets an update indicator on the specified element. Example: https://public.datagrok.ai/js/samples/ui/components/update-indicator
showColorPickerOpens a standalone color picker modal immediately, without a trigger element. Use when there is no persistent UI element to bind to (e.g. editing a canvas-rendered grid cell).
showPopupShows popup with the [element] near the [anchor]. tooltip, and popup menu.
spanRenders multiple objects as a span
splitHPositions child elements horizontally and allows you to resize them. Example: https://public.datagrok.ai/js/samples/ui/containers/splitters
splitVPositions child elements vertically and allows you to resize them. Example: https://public.datagrok.ai/js/samples/ui/containers/splitters
star-
tabControlExample: https://public.datagrok.ai/js/samples/ui/components/tab-control
tableCreates a visual table based on [items] and [renderer]. BE WARE: Indexing in the renderer function, due to HTML being totally awesome starts from 1, not 0. Because... What's a better way to make developers life miserable, right?
tableFromMapCreates an html table based on [map]. Example: https://public.datagrok.ai/js/samples/ui/components/html-tables
tableFromPropertiesCreates an editable html table for the specified items (rows) and properties (columns).
tags-
treeCreates new nodes tree. Example: https://public.datagrok.ai/js/samples/ui/components/tree-view
typeAhead-
virtualViewCreates a virtual list widget. Example: https://public.datagrok.ai/js/samples/ui/views/virtual-view
waitWaits for Future<Element> function to complete and collect its result. Example: https://public.datagrok.ai/js/samples/ui/components/loading-indicators
waitBoxWaits for Future<Element> function to complete and collect its result as a ui.box. Example: https://public.datagrok.ai/js/samples/ui/components/loading-indicators
wideForm-