View Full Version : Help accessing control formWindow

17 Jul 2008, 12:03 PM
I have a gridPanel that I am creating in a formWindow along with other components. I am setting the grid to hidden in the config object of the gridPanel. I am attaching a handler to a button inside of the formWindow that will call a function to load the store and set the gridPanel to visible. I cannot figure out how to set a variable and find the gridPanel inside the formWindow and access the config object and set hidden = false for the gridPanel. Anyone have any suggestions?

var onSearch = function() {
if (tbar.getFormWindow()){

var grdSearch = Ext.getCmp(tbar.formWindow.findById("grdSearch"));
//tbar.formWindow.render(grdSearch, "pgrdSearch");


var tbar = new Ext.ux.hhj.GridToolbar({
capabilities: {
Delete: true,
Download: true,
GetBlank: true,
GetById: true,
Insert: true,
Update: true
formWindow: new Ext.ux.hhj.FormWindow({
items: [
new Ext.Button({
text: "Search",
scope: this,
handler: onSearch
new Ext.form.TextField({
fieldLabel: "FirstName",
name: "FirstName",
allowBlank: false
new Ext.form.Checkbox({
fieldLabel: "Active",
name: "Active"
new Ext.ux.hhj.GridPanel({
columns: [
{dataIndex: "Name", header: "Name"},
{dataIndex: "Supervisor", header: "Supervisor"},
{dataIndex: "Department", header: "Department"},
{dataIndex: "Location", header: "Location"}
hidden: true,
//plugins: [tbar],
// renderTo: tbar.formWindow(),

store: new Ext.data.Store({
baseParams: {
a: "GetByName",
limit: Ext.ux.hhj.PAGESIZE
remoteSort: true,
hidden: true,
sortInfo: {field: "Name"},
proxy: new Ext.data.HttpProxy({url: "Employee.aspx"}),
reader: new Ext.ux.hhj.DataReader({
id: "EmployeeId",
ts: "EmployeeTS",
fields: [
{name: "Name", type: "string"},
{name: "Supervisor", type: "string"},
{name: "Department", type: "string"},
{name: "Location", type: "string"}

title: "User Properties",
url: "Security/User.aspx",
html: "<DIV id=pgrdSearch></DIV>",
autoScroll: true

17 Jul 2008, 12:29 PM
In the future, please use code tags when posting code to the forums...
Give your grid an id and retrieve a reference to it using Ext.getCmp('idOfTheGrid')

17 Jul 2008, 12:49 PM
That got it - thanks!!
sorry about not using code tags. I am new.
Thanks again.