Skip to content
Snippets Groups Projects
Commit ed1e122c authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Upgrade to be compliant with new classes.

parent c88349b9
No related branches found
No related tags found
No related merge requests found
/**
* The row editor toolbar plugin
*
* Add a toolbar to the grid with button to manipulate the App.grid.RowEditor.
* The latter is instantiated if not already create.
* Add a toolbar with buttons to manipulate the App.grid.RowEditor.
* Requires the App.grid.GridRowEditor plugin.
*
* The ptype of this component is pGridRowEditorToolbar.
*
......@@ -26,14 +24,9 @@ App.grid.RowEditorToolbar = Ext.extend(Object, {
var toolbar;
// create and initialize the underlying RowEditor
if (!grid.editor) {
grid.editor = new App.grid.RowEditor({
formModel: grid.model.formModel,
table: grid.model.table
});
grid.editor.init(grid);
// protection
if (!grid.rowEditor) {
throw new Error('no grid row editor !!!');
}
toolbar = grid.getTopToolbar();
......@@ -41,30 +34,30 @@ App.grid.RowEditorToolbar = Ext.extend(Object, {
toolbar.add([{
text: 'Add',
iconCls: 'silk-add',
handler: grid.editor.onAddRow,
scope: grid.editor
handler: grid.rowEditor.onAddRow,
scope: grid.rowEditor
}, ' ', {
text: 'Delete',
iconCls: 'silk-delete',
handler: grid.editor.onDeleteRow,
scope: grid.editor
handler: grid.rowEditor.onDeleteRow,
scope: grid.rowEditor
}, ' ', {
text: 'Duplicate',
iconCls: 'silk-clone',
handler: grid.editor.onDuplicateRow,
scope: grid.editor
handler: grid.rowEditor.onDuplicateRow,
scope: grid.rowEditor
}, ' ', {
text: 'Update',
iconCls: 'silk-update',
handler: grid.editor.onEditRow,
scope: grid.editor
handler: grid.rowEditor.onEditRow,
scope: grid.rowEditor
}, ' ', {
text: 'View',
iconCls: 'silk-view',
handler: grid.editor.onViewRow,
scope: grid.editor
handler: grid.rowEditor.onViewRow,
scope: grid.rowEditor
}, '-']);
}
});
Ext.preg('pGridRowEditorToolbar', App.grid.RowEditorToolbar);
Ext.preg('pGridRowEditorToolbar', App.grid.RowEditorToolbar);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment