diff --git a/static/plugin_dbui/src/appgridroweditorcontextmenu.js b/static/plugin_dbui/src/appgridroweditorcontextmenu.js index d2fc77c5ea6726ebe8ce9cf477856e8438b0a0f9..11ded891e42679413cfdc611e2c6eb05daa47627 100644 --- a/static/plugin_dbui/src/appgridroweditorcontextmenu.js +++ b/static/plugin_dbui/src/appgridroweditorcontextmenu.js @@ -4,6 +4,8 @@ * Display the context menu when the user right click on a row. * The content of the menu allows to manipulate the App.grid.RowEditor * + * Requires the App.grid.GridRowEditor plugin. + * * The ptype of this component is pGridRowEditorContextMenu. * * @extends Object @@ -16,7 +18,7 @@ Ext.namespace('App.grid'); App.grid.RowEditorContextMenu = Ext.extend(Object, { /** - * Private parameter identifying the type of plugin + * Private attribute identifying the type of plugin */ ptype: 'pGridRowEditorContextMenu', @@ -28,11 +30,9 @@ App.grid.RowEditorContextMenu = Ext.extend(Object, { var menu = new Ext.menu.Menu(); - // RowEditor can be shared between several plugin - // create and initialize the underlying RowEditor + // protection if (!grid.rowEditor) { - grid.rowEditor = new App.grid.RowEditor(); - grid.rowEditor.init(grid); + throw new Error('no grid row editor !!!'); } grid.addListener('containercontextmenu', this.onContainerContextMenu, menu);