I want to call reconfigure on a grid to change the column text like this example
However I want to do it from an external control that has nothing to do with the grid.
Need to find the reference to the grid because when I pass it into a variable, I get a no method error when calling reconfigure
Any help appreciate thanks
EDIT
If you have a look at the link in the post, then this function:
onShowOfficesClick: function(){
var grid = this.down('grid');
Ext.suspendLayouts();
grid.setTitle('Employees');
grid.reconfigure(this.createOfficeStore()
Shows how to reconfigure a grid.
What I'm trying to do is get the grid reference from an external function, not sure if its possible
Here's some of my code
var Social_Environment_Grid = Ext.create('Ext.data.Store', {
Goes to to create a store, not so relevant
Then is a seperate Jquery function I want to call
Social_Environment_Grid.reconfigure(false, newColumArray)
But I get an error Social_Environment_Grid has no method reconfigure, so I guess this is not the correct object reference
Hope this makes sense
Edit Fixed
Fixed it thanks to everyones comments and answers here was my problem
var Panel1 = Ext.create('Ext.panel.Panel', {
layout: 'fit',
height: 400,
layout: {
type: 'vbox', // Arrange child items vertically
align: 'stretch', // Each takes up full width
padding: 5
},
items: [{ // Results grid specified as a config object with an xtype of 'grid'
xtype: 'grid',
id: 'Panelxx1',
columns: [
Then call
Ext.getCmp('Panelxx1').reconfigure(false,alternativeIndex);
I was not referencing the grid, and also not calling the object reference correctly, thanks for everyone's help
reconfigure
method inExt.grid.Panel.prototype
so, except if you'd explicitly deleted it (from the prototype!), the variable you end up with is not a reference to a grid panel... Could you show us your code so we can see what's wrong? – rixo