jriff
20 Jun 2009, 1:26 PM
Hi All!
I have a viewport with a navigation tree and a tab panel. When clicking in the navigation tree a new tab is created with the following grid. I have made a listener for the dblclick event (as you can see). What I want is to display a FormPanel when that happens. But what do I render it to? As you can see, I am extending GridPanel thus making my own component - so I never know in what context I am. I just want the form displayed on top of the grid where ever it is being used.
Can somebody help?
var store= new Ext.data.JsonStore({
url: '/dealer_list/dealers.json',
restful: true
})
Caltric.DealersGrid = Ext.extend(Ext.grid.GridPanel, {
border: false
,initComponent: function() {
var config= {
store: store
,columns: [
{id:'id', header: 'ID', width: 30, sortable: true, dataIndex: 'id'},
{header: 'Name', width: 200, sortable: true, dataIndex: 'name'},
{header: 'Chain', width: 200, sortable: true, dataIndex: 'chain_name'},
{header: 'POS', width: 200, sortable: true, dataIndex: 'pos'},
{header: 'Address', width: 200, sortable: true, dataIndex: 'address'},
{header: 'City', width: 200, sortable: true, dataIndex: 'city'},
{header: 'Reseller ID', width: 200, sortable: true, dataIndex: 'reseller_id'}
]
,viewConfig: { forceFit: true }
,sm: new Ext.grid.RowSelectionModel({singleSelect:true})
,title:'Listing dealers'
,bbar: new Ext.PagingToolbar({
store: store
,displayInfo: true
,pageSize: 20
,prependButtons: true
})
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
Caltric.DealersGrid.superclass.initComponent.apply(this, arguments);
}
,onRender: function() {
this.store.load({
params: { start: 0, limit: 20 }
});
Caltric.DealersGrid.superclass.onRender.apply(this, arguments);
}
,listeners: {
'dblclick': function(){
Caltric.DealersForm.renderTo(?????????);
}
}
});
I have a viewport with a navigation tree and a tab panel. When clicking in the navigation tree a new tab is created with the following grid. I have made a listener for the dblclick event (as you can see). What I want is to display a FormPanel when that happens. But what do I render it to? As you can see, I am extending GridPanel thus making my own component - so I never know in what context I am. I just want the form displayed on top of the grid where ever it is being used.
Can somebody help?
var store= new Ext.data.JsonStore({
url: '/dealer_list/dealers.json',
restful: true
})
Caltric.DealersGrid = Ext.extend(Ext.grid.GridPanel, {
border: false
,initComponent: function() {
var config= {
store: store
,columns: [
{id:'id', header: 'ID', width: 30, sortable: true, dataIndex: 'id'},
{header: 'Name', width: 200, sortable: true, dataIndex: 'name'},
{header: 'Chain', width: 200, sortable: true, dataIndex: 'chain_name'},
{header: 'POS', width: 200, sortable: true, dataIndex: 'pos'},
{header: 'Address', width: 200, sortable: true, dataIndex: 'address'},
{header: 'City', width: 200, sortable: true, dataIndex: 'city'},
{header: 'Reseller ID', width: 200, sortable: true, dataIndex: 'reseller_id'}
]
,viewConfig: { forceFit: true }
,sm: new Ext.grid.RowSelectionModel({singleSelect:true})
,title:'Listing dealers'
,bbar: new Ext.PagingToolbar({
store: store
,displayInfo: true
,pageSize: 20
,prependButtons: true
})
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
Caltric.DealersGrid.superclass.initComponent.apply(this, arguments);
}
,onRender: function() {
this.store.load({
params: { start: 0, limit: 20 }
});
Caltric.DealersGrid.superclass.onRender.apply(this, arguments);
}
,listeners: {
'dblclick': function(){
Caltric.DealersForm.renderTo(?????????);
}
}
});