I've found GC an excellent framework for building a number of systems, and after producing 3 or 4 of them, there are some user requests which seem to be common across a range of applications. The biggest of these for me was a request to be able to edit more than one table row at a time - at the "bottom" of a typical database hierarchy, people often end up wanting to edit a small group of related rows at the same time.
In a "standard" GC implementation, you render a list view of the different rows, then "dip in" to edit one, "back out" to the list to select another, then edit that and so on. That has been a big usability issue for a couple of clients.
I had thought that I would need to break out into some custom code to achieve this, but finally worked out how to achieve it completely within GC - no mods required. In this specific instance, I'm modelling an event management scenario - where a given event will have an arbitrary number of staff positions, and each staff position will have a separate booking for each day of the event. So from the "staff position" list view we want to be able to edit every daily booking for a given position on a single edit screen.
You will need to create two controllers and two views - one pair will be used to provide the outer view, the other will provide the content of the inner multiple edit views.
In the outer view you will need some code like this, where I read in the primary keys for the bookings for a given position primary key (passed into the view in the controller code as detailed elsewhere):
(I set the iframe height to 1 as I resize it dynamically later on in the code)
Then later in the outer view template you just replace echo $output with echo $iframes and that part is done. For a given position id you will get an edit screen with however many iframes are needed for every booking related to that position. Now we just need to fill the iframes...
The key code for the inner controller is as follows, based around the core $crud->render() call:
All that is left is the inner view template, used within each iframe. This is essentially an "empty" template - we don't want any of the outer template appearing more than once. Here is the entire body of my inner template (you keep all of the stuff in the head, that's where all the jQuery trickery resides):
An entry for the div id in flexigrid.css sorts out odds and ends like the top margin.
The JavaScript trickery with that primary key? A combination of JS in both inner and outer views (constructed via PHP) means that all of the iframes scroll simultaneously when any one of them is scrolled.
If any of this is of interest to others, I'm happy to try and flesh it out further.