Thank’s for your question. At this time, the knimeService global variable isn’t fully documented. That being said, here is some commonly used functionality that’s worth mentioning:
knimeService.isInteractivityAvailable() - this will return true if the view is part of a composite view with other views (and able to pub/sub events) or false if the view is a single node view.
knimeService.setWarningMessage(msg, id) /
knimeService.clearAllWarningMessages() - these methods are available to manipulate the native KNIME warning message (usually seen in the upper right hand corner as a ‘!’ icon)
knimeService.setSelectedRows(tableId, selection, callback) /
knimeService.addRowsToSelection(tableId, selection, callback) /
knimeService.subscribeToSelection(tableId, callback) - registers the view with any selection events published in a composite view for the provided tableId (provided by the knimeDataTable). The callback function receives an event Object which contains the update information.
knimeService.unsubscribeSelection(tableId, callback) - deregisters the view from reacting to selection events when they are published in the composite view. Same parameters as in the sub method.
knimeService.subscribeToFilter(tableId, callback, filterElement) - registers the view to receive published filter events in the same composite view. TableId is the same as for selection and the callback function receives an event Object with the updated filter information (published by the Interactive Range Slider Filter Widget, or the Interactive Value Filter Widget) and the filterElement parameter can be retrieved using the knimeDataTable.getFilterIds() method.
knimeService.unsubscribeFilter(tableId, callback) - deregisters the view from reacting to filter events.
knimeService.isRowSelected(tableId, rowId) - returns true if the rowId provided is currently selected, false if not.
knimeService.getAllRowsForSelection(tableId) - returns the full global set of currently selected rowIds.
knimeService.addMenuItem(title, icon, element, path, flags) - adds a control element to the native KNIME dropdown menu in the upper right hand corner of the view. Title is the label assigned to the menu item, icon is the String name of an icon from the Font Awesome V4.7.0 library, element is the actual element created with one of the Menu Items methods below, path is an optional parameter (passing null is fine), flags can be: knimeService.CLOSE, .OK, .CANCEL, .LINK, .SMALL_ICON or undefined/null.
knimeService.allowFullscreen() - creates a native KNIME ‘fullscreen’ control button in the upper right hand corner of the view if it is in a composite view which allows the user to enter fullscreen mode when it is clicked.
knimeService.addButton(id, icon, title, callback) - creates a native KNIME control button in the upper right hand corner of the view provided: (id) the HTML id, (icon) the String name of an icon from the Font Awesome V4.7.0 library, (title) the hover text for the button and (callback) the function to fire when the button is pressed.
knimeService.addNavSpacer - adds space between the most recently added button and the next button to be added with the .addButton() method.
(all return elements to be added to the native KNIME dropdown menu using the addMenuItem method)
- knimeService.createMenuTextField(id, initialValue, callback, immediate)
- knimeService.createMenuNumberField(id, initialValue, minimum, maximum, step, callback, immediate)
- knimeService.createMenuSelect(id, initialValue, options, callback)
- knimeService.createMenuCheckbox(id, initialState, callback, value)
- knimeService.createMenuRadioButton(id, name, value, callback)
- knimeService.createInlineMenuRadioButtons(id, name, initialValue, options, callback)
knimeService.addMenuDivider() - does not return an element, but adds a horizontal bar to space the vertical distribution of menu items in the KNIME dropdown.
knimeService.log(message) - logs message
knimeService.logError(err) - logs error
knimeService.inlineSvgStyles(svg) - when provided an SVG element, this method applys all stylesheets available in the scope and context of the view as inline styles if possible.