load_module

AbstractItem.load_module(callback)
Domain:

client

Language:

javascript

Class:

AbstractItem()

Execution: asynchronous

Description

Use load_module method to dynamically load javascript file of an item module, before executing callback.

The method checks whether the module has been loaded, if not, loads the module from the server, initializes the item and then executes the callback function, otherwise just the callback function is executed. The item is passed to the callback function as a parameter.

The request to the server is executed asynchronously.

Parameter

Parameter

Type

Description

callback

function

Example

Bellow, the do_some_work function is executed only when an item module has been loaded:

function some_work(item) {
    item.load_module(do_some_work);
}

function do_some_work(item) {
    // some code
}

See also

Related functions

Related concepts