Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Add grid
this.grid = new Grid('CodeGrid', {
toolbarReload: false,
toolbarSearch: false,
toolbarEdit: false
});
this.grid.columns = [{ field: 'name', caption: 'Name', size: '100%', editable: { type: 'string' } }];
this.grid.onClick = (id) => this.selectCode(id[0]);
this.grid.onAdd = () => this.add();
this.grid.onDelete = (ids) => this.delete(ids);
this.grid.onChange = (id, value) => this.change(id, value);
this.grid.build('CODE-BEHAVIOR-LIST');
// Add code editor
await this.createEditor();
this.template = await Tools.LoadFile('./assets/templates/code.txt', false);
// Events
this.editor.core.onSelectObject.add(this.onSelectObject);
// Select object
if (this.editor.core.currentSelectedObject)
this.selectObject(this.editor.core.currentSelectedObject);
// Request extension
Extensions.RequestExtension(this.editor.core.scene, 'BehaviorExtension');
}