Comment #2 on issue 197 by
pvcsnat...@gmail.com: Form grid view
http://code.google.com/p/php-form-builder-class/issues/detail?id=197
Hi, I needed to mimic the behavior of the grid from version 2.3. I took
your code and refactored a bit to get what I need. I have thrown in some
custom elements and legacy code since I'm upgrading from version 2.3 of
PFBC on an existing site. This will need to be cleaned up a bit to be
merge-worthy. Note that modification of the core class is not required.
Usage: $form->configure(array(
"view" => new PFBC\View\Grid(array("map"=>array(1, 3, 1, 1, 1,
1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 4, 1, 2, 2, 1, 1)))
));
Notes: I use the legacy HTMLExternal element for things that shouldn't be
forced into the grid. The Section and Csrf elements are some of my custom
things... The former does the headings and the latter helps protect against
cross-site request forgery.
I also added in some inline styling (see line 72) since I need the ability
to hide certain elements and interact with certain elements via id (mostly
used for a grid within a grid scenario). There's probably a better way to
do all of this and I'd love to hear some feedback.
Attachments:
Grid.php 3.8 KB
2013-06-30 14_39_22-Grid Form Example - Opera.png 267 KB