blockEvent

temporarily blocks triggering of ALL events of the calling object

void blockEvent();

Example

$$('list').blockEvent();
$$('list').add({ text:'abc'}); //will not trigger list events 
$$('list').unblockEvent();

Details

Use the command with care, many actions in components are linked through events.

The most common use-case - preventing a component from repainting with each small operation:

//will repaint component 3 times
 
$$('list').add({ text:'111'});
$$('list').add({ text:'222'});
$$('list').add({ text:'333'});
 
//will repaint component only once (onStoreUpdated of List DataStore is blocked)
$$('list').data.blockEvent();
$$('list').add({ text:'111'});
$$('list').add({ text:'222'});
$$('list').add({ text:'333'});
$$('list').data.unblockEvent();
$$('list').refresh();
See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
If you have not checked yet, be sure to visit site of our main product Webix web development library and page of javascript layout product.