Issue 197 in php-form-builder-class: Form grid view

23 views
Skip to first unread message

php-form-bu...@googlecode.com

unread,
Mar 17, 2013, 12:28:36 AM3/17/13
to php-form-builder...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 197 by kaushal....@gmail.com: Form grid view
http://code.google.com/p/php-form-builder-class/issues/detail?id=197

What steps will reproduce the problem?
1. I used to use the project on 1.0 where their was a fantastic feature
called map , which allowed us to arrange our fields on any grid layout we
want. Looks like the feature is gone now.

I realized you have views to now handler layout, so I tried to create new
grid view called "View_Grid", I am planning to use bootstrap grid system
with controls-row here. I now need some way to pass map array to this new
grid class, $view of Form class is protected otherwise I could have used
that.

Any suggestions ?


What version of the product are you using? On what operating system?
PFBC 3.1 (PHP 5)

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

php-form-bu...@googlecode.com

unread,
Mar 17, 2013, 5:33:22 AM3/17/13
to php-form-builder...@googlegroups.com

Comment #1 on issue 197 by kaushal....@gmail.com: Form grid view
http://code.google.com/p/php-form-builder-class/issues/detail?id=197

Hi,

I have attached both demo of grid view I created and view source.

But this is only possible if I can pass a mapping parameters to the view
class like this on form setup:

$form->view->map=array('layout'=>array(2,3,2),'widths'=>array(6,6,4,4,4,6,6));

For now, I manually altered source code to make $view public instead of
protected.

Thanks
Kaushal

Attachments:
grid_layout_demo.PNG 7.1 KB
grid.php 2.4 KB

php-form-bu...@googlecode.com

unread,
Jun 30, 2013, 3:53:32 PM6/30/13
to php-form-builder...@googlegroups.com

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
Reply all
Reply to author
Forward
0 new messages