Open GoogleCodeExporter opened 9 years ago
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
Original comment by kaushal....@gmail.com
on 17 Mar 2013 at 9:33
Attachments:
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.
Original comment by pvcsnat...@gmail.com
on 30 Jun 2013 at 7:53
Attachments:
Original issue reported on code.google.com by
kaushal....@gmail.com
on 17 Mar 2013 at 4:28