Skip to content

blockEvent

temporarily blocks triggering of ALL events of the calling object

function blockEvent(): void
grid.blockEvent();
grid.add({ text:'abc'}); //will not trigger grid events
grid.unblockEvent();

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
grid.add({ text:'111'});
grid.add({ text:'222'});
grid.add({ text:'333'});
//will repaint component only once
grid.data.blockEvent();
grid.add({ text:'111'});
grid.add({ text:'222'});
grid.add({ text:'333'});
grid.data.unblockEvent();
grid.refresh();

Articles

API