Options
All
  • Public
  • Public/Protected
  • All
Menu

Holds information and state about an instance of a particular menu.

Hierarchy

Index

Constructors

constructor

Properties

Protected _isDestroyed

_isDestroyed: boolean

app

inherited

hasExecutableMenuItems

hasExecutableMenuItems: Observable<boolean>

A boolean which istrue if the menu has any executable menu items, false if not.

id

id: string

libraryId

libraryId: string

menuContext

menuContext: Observable<any>

Context associated with the menu. If commandParameter is not specified on a menu item, it is passed the menuContext itself upon invocation. If commandParameter is specified, it is passed to the specified command. If commandParameter has properties with string value tokens in the format of {{SomeProperty}}, these properties will be resolved against properties of the menuContext itself.

menuDescription

menuDescription: Observable<string>

The description of this menu.

menuId

menuId: string

The unique ID of the menu.

menuItems

Menu items associated with this menu.

menuSourceView

menuSourceView: ViewBase

The source view which has currently invoked this menu, or the view to which this menu 'belongs.

menuTitle

menuTitle: Observable<string>

The title of this menu, which may be used for presentation purposes.

visibleMenuItems

Menu items that are currently executable or are currently non-executable but have their "hideOnDisable" setting set to false.

Static DefaultParameterName

DefaultParameterName: string

The default menu context parameter name.

Methods

Protected _handleContextChanged

  • _handleContextChanged(menuContext: any): void
  • Applies menu context changes to all items in the menu.

    Parameters

    • menuContext: any

    Returns void

Protected _handleExecutableItemChanged

  • Handle the canExecute for a single menu item changing without recalculating the whole menu

    Parameters

    Returns void

Protected _handleMenuItemsChanged

  • _handleMenuItemsChanged(changedArgs: any): void
  • When the collection changes, we'll need to decide how to handle the elements. Removals and clears remove from the executable list, Additions need only re execute canExecuteChanged to decide whether to display or not.

    Parameters

    • changedArgs: any

      Indicate the type of change made to the menu items.

    Returns void

auto

  • auto(arg0: any, arg1: any, arg2: any): void
  • Binds a handler to an Observable or to a dojo.connect. Binding to an Observable:

    ``` this.auto(someObservable, function (newValue) { });

    with explicit scope:

    this.auto(someObservable, this, function (newValue) { });

    Alternately, pass an event name as a string to use dojo.connect:

    this.auto(window, "onclick", function () { }); ```

    Parameters

    • arg0: any

      Either an Observable (for observable bindings) or a regular object (if arg1 is a string)

    • arg1: any

      If arg0 is an Observable, a function or scope object. Otherwise, an event name (to use with dojo.connect).

    • arg2: any

      If arg0 is an Observable, a function handler.

    Returns void

computeExecutableMenuItems

  • computeExecutableMenuItems(): void
  • This function executes when the canExecute of any of the menu items changes, or a new element is added to the list.

    Returns void

destroy

  • destroy(): void
  • Destroys the object completely

    Returns void

destroyBindings

  • destroyBindings(): void

getResource

  • getResource(resourceKey: string, locale?: string): string
  • Gets a language resource from the Application's resource dictionary, given a key, and optional locale. Returns null if the resource does not exist.

    Parameters

    • resourceKey: string
    • Optional locale: string

      The locale of the resource to fetch. Defaults to the current application locale.

    Returns string

initialize

  • initialize(config: any): void
  • Initializes this menu view model based on the provided configuration

    Parameters

    • config: any

      The configuration for this menu view model

    Returns void

onDestroy

  • onDestroy(): void
  • Clean up when this menu view model is destroyed

    Returns void

setupMenu

  • setupMenu(menuId?: string, resolveCanExecute?: boolean, menuViewId?: string): void
  • Retrieves the menu for this view model from the menu registry and sets it up. This is done only when the view requests it as part of it's attach routine.

    Parameters

    • Optional menuId: string

      the id of the menu to set up this view model for. If omitted, this.menuId property must already be set.

    • Optional resolveCanExecute: boolean

      Whether to resolve the executable status of menu items now, or attempt to do so when the menu is viewed. Defaults to true.

    • Optional menuViewId: string

      If 'resolveCanExecute' is false this should be set. When this view is activated the menu items will resolve.

    Returns void

trackCommandHandler

  • trackCommandHandler(command: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.commands.Command}, disposing it when this object is disposed with the destroy method.

    Parameters

    • command: any
    • token: any

    Returns void

trackSubscription

  • trackSubscription(event: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.events.Event}, disposing it when this object is disposed with the destroy method.

    Parameters

    • event: any
    • token: any

    Returns void