PDA

View Full Version : Obtaining RowEditor Plugin on grid Panel from within Designer Generated code



sramsay
21 Oct 2011, 2:18 AM
What is the correct way to obtain the roweditor plugin from within a gridpanel when using Ext Designer generated code? I'm struggling with this and have tried all sorts of options.....

The code generated by designer 1.2.2 is:-


/*
* File: app/view/ui/MyGridPanel.js
* Date: Fri Oct 21 2011 10:31:04 GMT+0100 (GMT Daylight Time)
*
* This file was generated by Ext Designer version 1.2.2.
* http://www.sencha.com/products/designer/
*
* This file will be auto-generated each and everytime you export.
*
* Do NOT hand edit this file.
*/

Ext.define('MyApp.view.ui.MyGridPanel', {
extend: 'Ext.grid.Panel',

height: 250,
width: 400,
title: 'My Grid Panel',
store: 'MyJsonStore',

initComponent: function() {
var me = this;

Ext.applyIf(me, {
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'id',
text: 'Id'
},
{
xtype: 'gridcolumn',
dataIndex: 'name',
editor: 'textfield',
text: 'Name'
}
],
viewConfig: {

},
dockedItems: [
{
xtype: 'toolbar',
dock: 'top',
items: [
{
xtype: 'button',
text: 'Add'
},
{
xtype: 'button',
text: 'Delete'
}
]
}
],
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {

})
]
});

me.callParent(arguments);
}
});

and the file to edit is :-



/*
* File: app/view/MyGridPanel.js
* Date: Wed Oct 19 2011 10:37:01 GMT+0100 (GMT Daylight Time)
*
* This file was generated by Ext Designer version 1.2.0.
* http://www.sencha.com/products/designer/
*
* This file will be generated the first time you export.
*
* You should implement event handling and custom methods in this
* class.
*/

Ext.define('MyApp.view.MyGridPanel', {
extend: 'MyApp.view.ui.MyGridPanel',

initComponent: function() {
var me = this;
me.callParent(arguments);
me.down('button[text=Add]').on('click', me.onAddClick, me);


},
onAddClick: function() {
var me = this;
var roweditor=me.down( 'what do I put here? ');

// Do something with it...
}
});


So in my onAddClick I want to obtain the editor and do something with it, any ideas, help appreciated....