PDA

View Full Version : How to open a Form from a Grid



dizo
8 Mar 2010, 2:02 AM
Hello,

I have a Problem with a grid. I plan to open a new form with the data which was clicked in a grid. For example a user double click a Row, oder he click on a specific link in the row (show, edit..) then a Form should be loaded.

The Problem is that i dont want to load a new page - i use as basic a Layout like the "Layout-Browser example" - so it should be loades in a new Page in the Content Frame.


- the Next Problem is how to load Data into a Form? I already bought the "Learning extjs book" and know how to load data with XML into a form on a new page, but if i try this with the "Layout Browser Example" Layout it wont work. No Data will be loaded when i click in the Treepanel to load the content (just the empty form). If i put the same JS File into a new HTML File (and just this JS File) it worked great.

The Problem is just within the "Layout-Browser Example".

Is it possible to create a Rich User Interface which lots of Menus in the Style of "Layout-Browser Example" or is it better to load everytime a new Page?

Thanks in Advance,
Dieter

Sgt.Pepper
8 Mar 2010, 2:56 AM
If this is your first steps with Extjs, you should probably start small: Don't mess around with such a complex layout in the beginning. You could create the form inside a Ext.Window, which will actually appear in the same browser window.

Later you can refactor the code, and move that form into a tab panel or whatever..


For you other question: there are a lot of examples, which cover the data binding between grids and other objects.

See these examples for a start:
http://www.extjs.com/deploy/dev/examples/grid/binding-with-classes.html
http://www.extjs.com/deploy/dev/examples/form/form-grid.html