Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple Grid on Agile Toolkit , PHP5
<?php
$g=$p->add('Grid');
// All the new views or objects needs to be added. When you do that - new object becomes child. This determines location where it appears on the page.
// For example $p is the "Demo" tab. What you add into $p will always be in there.
$g->addColumn('name');
// You can define multiple columns inside grid using addColumn() method. Columns must correspond with the hash keys in the data
$g->addColumn('surname');
// There are 3 ways how you bind Grid with source. 1: Set static source, 2: Set data table through dynamic query, 3: Assign model through controller
// Here we are using #1
$g->setStaticSource(array(
array('name'=>'John','surname'=>'Smith'.rand(1,20)),
array('name'=>'Peter','surname'=>'Tester'.rand(20,40))
));
@romaninsh

This comment has been minimized.

Copy link
Owner Author

romaninsh commented Nov 1, 2010

@romaninsh

This comment has been minimized.

Copy link
Owner Author

romaninsh commented Nov 1, 2010

runs on Agile Toolkit: http://github.com/atk4/atk4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.