Reputation: 48
How can I get any grid's[grid panel] id???
I'm new to Ext JS
`Ext.getCmp('id')`,
This doesn`t work.
Thanks in advance.
Upvotes: 1
Views: 2788
Reputation: 2216
try this
for ExtJS 3
Ext.select("div.x-grid-panel").elements[0].id
Ext.getCmp(Ext.select("div.x-grid-panel").elements[0].id
for ExtJS 4
Ext.select('.x-grid').elements[0].id
refer Ext-method-select
Upvotes: 2
Reputation: 13917
You can get the id of any component by just accessing the .id
property:
var comp = Ext.create('Ext.Component', {
html: 'Hello world!',
id: 'foo',
renderTo: Ext.getBody()
});
console.log(comp.id); // prints: foo
Upvotes: 0