PC_Oil
PC_Oil

Reputation: 48

Get any grid`d id and refresh that particular grid

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

Answers (2)

MMT
MMT

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

Rene Saarsoo
Rene Saarsoo

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

Related Questions