API Docs for: 5.0.3
Show:

TabbedNavigation Class

TabbedNavigation - control for manage history

Constructor

TabbedNavigation

()

Methods

addCleanFunc

(
  • func
)

Add function to be called once during Control cleanUp

Parameters:

  • func Function

    Function to add

addControl

(
  • controlClass
  • initParams
)
Object

Creates a new sub-control.

Parameters:

  • controlClass String

    Class of the new control.

  • initParams Object

    Initialization parameters.

Returns:

Object:

The new control.

addToContextMenu

(
  • Array
)

Adds item(s) to control context menu.

Parameters:

  • Array Array | | Function

    of menu items to add, or function returning menu items.

canDrop

(
  • Event
)
Bool

Control is allow drop objects.

Parameters:

  • Event Object

    object. dataTransfer property is used for D&D operations

Returns:

Bool:

true if dragged object can be dropped here

cleanUp

()

Should clean up all the control stuff, i.e. mainly unlisten events.

dragEnter

(
  • Event
)

Handle drag enter operation

Parameters:

  • Event Object

    object. dataTransfer property is used for D&D operations

dragLeave

(
  • Event
)

Handle drag leave operation

Parameters:

  • Event Object

    object. dataTransfer property is used for D&D operations

dragOver

(
  • Event
)

Handle drag over operation

Parameters:

  • Event Object

    object. dataTransfer property is used for D&D operations

drop

(
  • Event
)

Handle drop operation

Parameters:

  • Event Object

    object. dataTransfer property is used for D&D operations

filterSource

(
  • phrase
)
Object

Filters dataSource based on given criteria (used when searching/filtering items within, e.g. via search bar)

Parameters:

  • phrase String

    string phrase to filter

Returns:

Object:

String message or object with detailed data

formatStatus

() Object

Format status text in this callback, when using object with detailed data.

Returns:

Object:

String message or object with detailed data

getDropMode

(
  • Event
)
String

Gets new drop mode

Parameters:

  • Event Object

    object. dataTransfer property is used for D&D operations

Returns:

String:

Drop mode

getParentControl

(
  • topParentCtrl
)
Control

Returns the first ancestor in the HTML DOM tree, that has controlClass and data-id. Searching is stopped on topParentCtrl, if defined.

Parameters:

  • topParentCtrl Object

    ControlClass of the top parent, where to stop searching.

Returns:

Control:

Parent Control or undefined if there's no parent.

getPersistentStateRootControl

() Object

Returns control to decide which subcontrols should be stored e.g. Multiview component overrides this as it stores states only for the active control/view

Returns:

Object:

object control

getPersistentStateRootKey

() String

Returns root key string under which the values are stored in persistent.JSON file on the disk.

Returns:

String:

store key id

localListen

(
  • object
  • event
  • func
  • [bool]
)

This method is pretty similar as app.listen(), but app.unlisten() is called automatically in Control.cleanUp()

Parameters:

  • object Object

    Object where to set listener

  • event String

    Event of the listener

  • func Method

    Method for callback dispatch

  • [bool] Method optional

    Capture?

localPromise

(
  • object
)
Promise

This method is supposed to automatically cancel running promises when component is going to destroy.

Parameters:

Returns:

makeDraggable

(
  • Object
  • true
)

Control is allow drag object

Parameters:

  • Object Object

    to enable/disable drag

  • true Bool

    when object can be dragged. Default is true

raiseEvent

(
  • eventName
  • details
  • [isCancelable]
  • [canBubble]
  • sender
)
Boolean

Raise the event on the Control

Parameters:

  • eventName String

    Name of the event

  • details Object

    Custom parameters to be sent with the event

  • [isCancelable] Boolean optional

    Whether the event can be canceled.

  • [canBubble] Boolean optional

    Whether the event can bubble.

  • sender Object

    of the event. Container by default.

Returns:

Boolean:

Success. If 'false', the event was canceled.

Example:

if (!this.raiseEvent('selecting', {
    tabIndex: value,
    oldTabIndex: oldSelected
}, true))
    return; // canceled, do not change selection

requestFrame

(
  • callback
  • [callbackID]
)

Request an animation frame in the control context. If the control has been cleaned up, then the callback will not execute.

Parameters:

  • callback Function

    Callback to run.

  • [callbackID] String optional

    Optional ID for callback, so that multiple instances of the callback do not execute at the same time.

Example:

this.requestFrame(function () {
    // this callback will be executed at a maximum of your monitor's natural refresh rate.
}, "myUniqueFrameCallbackName");

requestFrameMM

(
  • callback
  • [callbackID]
)

Request an animation frame in the control context, with the same features as requestAnimationFrameMM(). If the control has been cleaned up, then the callback will not execute.

Parameters:

  • callback Function

    Callback to run.

  • [callbackID] String optional

    Optional ID for callback, so that multiple instances of the callback do not execute at the same time.

Example:

this.requestFrame(function () {
    // this callback will be executed at a maximum of your monitor's natural refresh rate when focused, maximum of 30 fps when not focused, and maximum of 2 fps when window is not visible.
}, "myUniqueFrameCallbackName");

requestIdle

(
  • callback
  • [callbackID]
  • [useFirst]
)

Calls requestIdleCallback, cancels the previous sheduled callback on cleanup or multiple calls

Parameters:

  • callback Function

    Callback, which should be called when idle

  • [callbackID] String optional

    String name, which identifies the callback. If present, it cancels the previous sheduled callback

  • [useFirst] Boolean optional

    Valid only if callbackID is present, if true, previous unfinished timer is finished and the last is revoked

requestTimeout

(
  • callback
  • timeMS
  • [callbackID]
  • [useFirst]
)

Calls setTimeout, cancels the previous sheduled callback on cleanup or multiple calls

Parameters:

  • callback Function

    Callback, which should be called after timeout

  • timeMS Integer

    Timeout, in ms

  • [callbackID] String optional

    String name, which identifies the callback. If present, it cancels the previous sheduled callback

  • [useFirst] Boolean optional

    Valid only if callbackID is present, if true, previous unfinished timer is finished and the last is revoked

restorePersistentStates

()

Restores persistent (class) states for the control class and all subcontrols, this stores global (class) state (is same for all instances of the control)

restoreState

(
  • fromObject
)

Restores state of the control and all its subcontrols having data-id specified.

Parameters:

  • fromObject Object

    hierarchical object including states of the control and the subcontrols

setDragElementData

(
  • Object
  • Drag
)

Set details for dragged element

Parameters:

  • Object Object

    to drag

  • Drag Object

    event object

setStatus

() Object

Set status text. Can be simple string or object with data formatted later in formatStatus method.

Returns:

Object:

String message or object with detailed data

storePersistentStates

()

Stores persistent (class) states for the control class and all subcontrols, this stores global (class) state (is same for all instances of the control)

storeState

() Object

Stores state of the control and all its subcontrols having data-id specified.

Returns:

Object:

hierarchical object including states of the control and the subcontrols

thenWithProgress

(
  • pPromise
  • [params]
)

Method for handling Promise with delayed progress.

Parameters:

  • pPromise Promise

    Passed promise

  • [params] Object optional

    Object with possible parameters:

    • thenFunc - function called after resolving promise
    • errorFunc - function called after rejecting promise
    • delayedFunc - function called after given delay
    • delayMS - progress delay, default 100ms. Progress is displayed after this time, in case promise was not resolved yet
    • progressText - text displayed in delayed progress, default string is "Getting data"
    • progress - SimpleTasksController object, used for progress. If not present, use global progress.

Properties

contextMenu

Menu

Gets/sets context menu of the control. It could be also a function returning Menu object.

disabled

Bool

Gets/sets data-disabled attribute of the control and his childs

dockable

Boolean

Gets/sets dockable status of the control.

dockMenuItems

Menu

Gets/sets dock menu of the control. It could be also a function returning Menu object.

dockTitle

String

Gets/sets dock title.

isDock

Boolean

Gets/sets isDock status of the control.

isSearchable

Boolean

Get/set whether this control is searchable (e.g. via search bar)

minWidth

Number

Gets/sets min-width of the control, in pixels.

parentView

Object

Gets/sets view data.

statusParams

Object

Gets/sets params for statusbar.

tabIndex

Integer

Gets/sets tabIndex property. Use instead of tabIndex in HTMLElement for correct handling of disabled state.

visible

Boolean

Gets/sets visibility state of the control.