Master / details grid on two pages

Hello, I’m interested in making a master detail grid / form, with the grid of a list of animals on the first page and the details of the selected animal in the second page.

I’ve read this discussion
http://forum.dhtmlx.com/viewtopic.php?f=22&t=25498&p=81213&hilit=form+second+page#p81213

It’s ok for Dhtmlx touch.

I would like to adapt it to a non touch application.

My code is:

grid.php

....
// -----------------------------------------------------
// ----------------- GRID ANIMALI ----------------------
// -----------------------------------------------------

		var mygridAnimali = new dhtmlXGridObject('gridboxAnimali');
		mygridAnimali.setImagePath("../dhtmlxSuite/dhtmlxGrid/codebase/imgs/");
		mygridAnimali.setHeader("Id Cliente, Specie,Razza");
		mygridAnimali.setInitWidths("150, 150, 150")
		mygridAnimali.setColAlign("left, left, left")
		mygridAnimali.setColTypes("ro,ed,ed");
		mygridAnimali.setSkin("dhx_skyblue")
		mygridAnimali.enableColumnAutoSize(true);
		mygridAnimali.init();
		mygridAnimali.loadXML("data-animali.php");		
		//mygridAnimali.attachEvent("onRowSelect", doOnRowSelected);
		var mydp = new dataProcessor ("data-animali.php");
		mydp.init(mygridAnimali); 

.....

detail.php

[code]

[/code]

How can I link the selected animal to it’s relative details form ?

I think that the “bind” method of the form class doesn’t work between two separate page.

Hello
May be this link will be usefull for you:
docs.dhtmlx.com/doku.php?id=dhtmlxdatastore:toc

Thank you, but I didn’t understand. How can I bind a form to a grid, if the grid object is declared in another page ?

Any help ??

How can I bind a form to a grid, if the grid object is declared in another page ?
You can’t. Such technique works only if you have both the grid and the form on the same page.
In the touch example - all component was on the same page.
If you need to use grid and form on different pages, then you can just assign a code to the onRowSelect event from which open a details page with clicked row id as url parameter, and in details page use parameter from the url to load data in the form.

Ok, thanks.
So if I wanted to use the Datastore, I could use a layout in the same page, with the different Dhtmlx component in different cell ?

If you are using layout with different components in different cells - the solution with data binding will work correctly.

You can do it with datastore or without it, as form can be binded directly to the grid ( so datastore is optional )

Ok, thanks :slight_smile: