CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Grid in grid

Print topic Send  topic

Author Message
jokecoat

Posts: 43
Posted: 05/26/2014, 1:51 PM

Is there a way to put a grid inside a grid?

What i'm trying to do is to make a sort of Master-detail grid. The first row shows some Master details with a link or button and when clicked the second row should appear with more details. The details can have more then one row.

I tried the report, but it repeats the header for the detail section for every row :(
View profile  Send private message
eratech


Posts: 513
Posted: 05/27/2014, 2:15 AM

Just off the top of my head, you could try some of the different layouts to put all the Master and Details fields you need in a 'single grid row' but put another row in manually, move the Detail fields to that row, then show/hide the Detail fields using jquery.

Or retrieve a Detail grid from a service page (or includable, again with jquery) into the page when the Master row or button is clicked.

If either of these sound useful please let me know and I'll see if I can throw an example together.

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
jokecoat

Posts: 43
Posted: 05/27/2014, 8:24 AM

Hi Eric,

Thank you for your reply.
Since the details has a different table header i guess the best solution would be the include page.
I'll give it a try later on.

If you have any hints on how to show/hide, i would love your ideas :-)

Renze
View profile  Send private message
jokecoat

Posts: 43
Posted: 05/27/2014, 1:28 PM

Well, the include option doesn't work..:(
I get the error message: Include page cannot be inserted into Grid.

I'm not sure what you mean with service page. Could you please explain?
View profile  Send private message
eratech


Posts: 513
Posted: 05/27/2014, 9:28 PM

Sorry, I think I was imprecise with the 'include' page. I sometimes use 'includable' pages to load parts of pages into a larger page, but they are not really CCS include pages. I treat them like a CCS service page which usually returns formatted data like a grid but not a full page.

What I have done in the past is use some jquery to load another page into a DIV on the current page depending on some event. So you could...

1. Create a small single page with the grid of 'details' and no formatting ('master page' formatting should apply). Passing in some master ID (or multiple ID's) should let this detail page return the details you want.

2. In the master page grid, put a button or link (class 'detailbutton') to 'show details' and use some jquery to handle the clicks (see *rough* code below)

3. when the button or link is clicked you get the master id (could be a hidden text field, or attribute on something else) and pass it to the details page in (1). It will be loaded to the relevant DIV on the page.

Alternatively, you could get a similar function using the 'modal' popup Features (there are some examples in the Help about editing an Employee's details after clicking on their name in a list. Probably easier to use too.

*Rough code to indicate how it might be done - don't just copy & paste*

  
		$(".detailbutton").click(function() {  
			// add the details after the clicked item  
			var divdetail='<div class="added" id="detail">Details</div>'  
			$(this).after(divdetail);  
			// load the results of 'detailspage.php' into div 'detail', Note: serialise will add querystring items for those named fields  
			//, so make sure the detailspage is expecting them in the query  
             $("#detail").load("detailspage.php", $("#employee_id , #organisation_id").serialize() );  
		    });  
		});  

See also this jsfiddle for some pointers of adding divs after items and referencing them: http://jsfiddle.net/7yU3n/

Hope it helps

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.