PDA

View Full Version : Grid with new button which should open a new window



sajan
16 Jun 2010, 7:16 AM
Dear all,
I am in a complete dead lock situation so any help will be appreciated.
1. I have a grid and a toolbar built in designer.
2. data is loading fine in the grid.
3. there is a new button in the toolbar
4. so if the new button is clicked then it should open a new window
5. same for double click event on the grid.
can anybody suggest me how to do it.
thanks is advance.

j-joey
17 Jun 2010, 3:08 AM
you can add listeners to button and grid's rows.

i assume that your main component is your grid and its jsClass is named MyGrid

when you export the project MyGrid.js and MyGridUi.js will be generated. you can use MyGrid.js to implement your events and other things that you cannot set in the designer...

you can implement your event under the line "MyGridUi.superclass.initComponent.call(this)".

its a good idea to give autoRefs to components which you're going to set something here.

6sigma
17 Jun 2010, 3:19 AM
Hi,

I have the same problem.

Where I build the new window ... In a new project Designer or in the same project

j-joey
17 Jun 2010, 10:56 AM
by window, do you mean Ext.Window or browser window?

6sigma
17 Jun 2010, 11:14 AM
Hi j-joey,
I have a project Designer who included MyGrid and a toolbar with a button. When I click on the button, I would like to open a new Ext.window (MyWindow). My question … where do I design this new window, in the same project, below MyGrid or in a new project Designer.


Thank-you,

j-joey
17 Jun 2010, 11:35 AM
you can add it by using Component -> New Component menu. It helps to add root components to you project. When you export designer will generate all root components and stores as separate js files. so you can assemble them later.

ps. don't forget you should include window definitions before the grid's.

jarrednicholls
18 Jun 2010, 8:29 AM
Thanks joey for the help here. A little trick too: you can also drag/drop components from the Toolbox onto any blank part of the Design view (we call it the "canvas"). Or, if the canvas has no selected component, you can double-click a component in the Toolbox to add it as a root node.

The Ext.Window should definitely be a separate "root" or "top-level" component within the same project...no need to have a separate project. It should *not* be a child of your grid component.