PDA

View Full Version : Grid and Form access by Id



katovl
10 Aug 2007, 1:54 AM
Hi,

is there any possibility to get access to an Ext.form.Form or an Ext.grid.Grid by their Ids? Each time I need later access to a Grid, I need to make a reference, pass it as function parameters, etc.

We can get Elements by Id, so whats the problem about casting an Ext.Element to a Ext.form.Form / Ext.grid.Grid if that Element is such a thing?

matjaz
10 Aug 2007, 3:28 AM
You can create your own gridmanager which holds references to grids.
But if you're using for example GridPanel you have a reference of grid in this panel, reference to panel in layout etc.

evant
10 Aug 2007, 4:21 AM
http://extjs.com/deploy/ext/docs/output/Ext.ComponentMgr.html#get

katovl
10 Aug 2007, 8:29 AM
Well ok, this works for forms, but Grid is not a Component, right?

And I came to the conclusion, that it would be better, to have generic access to Grids and Form, means that I would like to get all Grids and Forms in Arrays, so that I could iterate over the Collections, read/manipulate the data. (As I wrote in another thread, I want to switch language specific headers, fieldLabels etc., so its better to do make it as reusable as possible...)