Best way to integrate the display of multiple grids on one page

QuestionsBest way to integrate the display of multiple grids on one page
steven M borruso asked 3 years ago

Hi Abu,

I’ve developed 6 grids (mostly as separate php files) and now want to integrate the display/control of all grids on one HTML page with the ability to collapse them individually without using IFramesĀ  or a JQuery accordion.

The grids are currently developed as such –

grid_1 which must act as the “master” grid for all other grids on the page based on the row selected

grid_2 is currently a subgrid of grid_1 and coded in a separate php file

grid_3 is currently a “detail” grid to grid_1 and coded within grid_1 php file

grids 4,5,6 are all currently in separate “stand alone” php files

I would like to keep all grids coded in separate php files (don’t want to have to merge them all into one file) and would rather they didn’t display asĀ  “subgrids” within grid_1

I’d like the display and collapse control of all grids to look / act like a “detail” grid does (grid_3 above ) … but again without having to merge the php code into the grid_1 php file.

I tried controlling all this by moving things into IFrames and also using JQuery accordions but things didn’t act as I wanted them to.

I’ve looked at all the demo examples (and code) but didn’t see a way to display/control all grids as a “detail” grid of grid_1 without having to merge all code into grid_1.

The hard part of creating all these grids is done … just need a way to stitch the display/control of them into one page in a maintainable way.

Any assistance/ideas are most appreciated.

Thanks !

Steve

 

 

 

 

1 Answers
Abu Ghufran Staff answered 3 years ago

Hello,

Beside the subgrid (grid2) which is already part of main page, you can do a

include_once(“grid3.php”);
include_once(“grid4.php”);
include_once(“grid5.php”);

on main php page where you need to have grid code.

This way, code of each grid will be in separate files and execute in single php file.

The external grid php code should not have any HTML out. It’s function should be only to prepare $out variable (e.g. $out = $g->render(‘list3’);) … Which you can echo on desired parent grid’s html code.

Also note that JS/CSS files are not to be included in external grids as all will be combined after include call and only one inclusion of css/jss files on main page will suffice for all.

A similar demo is located here, it does not have external files but mater details on a single page.
https://phpgrid.org/demo/demos/master-detail/master-multi-detail.php

(code: demos/master-detail/master-multi-detail.php)

Hope it make sense.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

7 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?