Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A view registers with the framework via a call to the addView(...) function.

Code Block
languagejs
onos.ui.addView('viewId', {
    preload: preload,
    reset: reset,
    load: load,
    unload: unload,
    resize: resize,
    theme: theme
});

The first argument to the function is a short string identifier for the view. 

The second argument to the function is an inline object block with the given keys, whose values are references to callback functions:

preloadThis function is called only once, the first time the view is loaded. It is called after the view's <div> has been added to the DOM.
resetThis function is called just before the view is shown. It can be used to clear stale data from the view.
loadThis function is called when the view is loaded.
unloadThis function is called when the view is unloaded. The view may use this to drop references to cached data, or stop background tasks.
resizeThis function is called when the view has been resized.
themeThis function is called when the user has toggled the theme.

 .code to go here...

 

Topology View

<details of websocket communication with the server>

...