View Full Version : complete initialConfig and the variables assigned in Ext.onReady.

11 Jun 2013, 12:56 AM
Im trying to make a simple mini editor that can move objects from one container to another and saving the changes on the backed. So i could rearrange buttons or move some to the bbar from the tbar.

First problem is when i check the initialConfig of a grid, the containers (tbar and bbar) is still object references. Is there a way to get the tbar and bbar initialConfig as the string they were before object contruction.

Furthermore can i get a list of the variables assigned in the Ext.onReady scope? Something like the window object in normal javascript.

Any help or pointers would be appreciated.



The initial simple drag'n'drop function.

function(e) {
var newLabel = Ext.create('Ext.form.Label', {
text: 'DropZone',
margin: '0 10 0 10',

var id = newLabel.id;
function (v){
v.dragZone = Ext.create('Ext.dd.DragZone', v.getEl(), {
getDragData: function(e) {
var sourceEl = e.getTarget(v.itemSelector, 10), d;
if (sourceEl) {
return v.dragData = {
sourceEl: sourceEl,
repairXY: Ext.fly(sourceEl).getXY(),
ddel: sourceEl,
elm: v

getRepairXY: function() {
return this.dragData.repairXY;
Ext.create('Ext.dd.DropTarget', id, {
notifyDrop: function (ddSource, e, data) {
notifyEnter: function (ddSource, e, data) {

13 Jun 2013, 1:28 PM
You can access the initial config in the initComponent before doing the callParent() method within initComponent. It might be best to store it in your own property for later access or you can go after the instance's proto's tbar property (see example below).

As for the variables assigned at onReady - I've not seen a list like that.

Ext.create('Ext.data.Store', {
fields:['name', 'email', 'phone'],
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'

Ext.define('MyGrid', {
extend: 'Ext.grid.Panel',
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
height: 200,
width: 400,
tbar: [{
text: 'Test'

initComponent: function () {
// this.initialTbarConfig = this.tbar;

Ext.create('MyGrid', {
renderTo: Ext.getBody()