Reference tables

Basic info about DataStructure here >>

Usage

//! Column group_name must exists in data
//! You have to manually join table before you create source

$mesourApp = //instance Mesour\Components\Application\IApplication
$source = //some <a href="http://components.mesour.com/version3/component/sources/" target="_blank">data source</a> or two-dimensional array

//! set one to one reference to column in data
$source->getDataStructure()
    ->addOneToOne('group_name', 'groups', 'name');
// group_name = column alias existing in data
// groups = joined table name or entity classname
// name = column key on joined table

$grid = new Mesour\UI\DataGrid('exportDataGrid', $mesourApp);

$grid->setSource($source);

$grid->enableEditable();

$container = $grid->addContainer('surname', 'Name')
    ->setOrdering(TRUE);

$container->addText('surname', 'Surname');

$container->addText('name', 'Name');

//! set column with related column key
$grid->addText('group_name', 'Group');

$grid->addText('email', 'E-mail');

$grid->render();
Info Try to inline edit any group in Demo :-)

Demo


NameGroupE-mail
Doe John Group 1john.doe@test.xx
Norman Stuart Group 1stuart.norman@test.xx
Wilson Jan Group 1jan.wilson@test.xx
Erickson Alberta Group 1alberta.erickson@test.xx
Figueroa Ethel Group 1ethel.figueroa@test.xx
Martin Max Group 1max.martin@test.xx
Manning Melody Group 1melody.manning@test.xx
Petterson John Group 1john.petterson@test.xx
Larson Peter Group 2peter.larson@test.xx
Wells Ada Group 2ada.wells@test.xx
Goodwin Ian Group 2ian.goodwin@test.xx
Burns Erma Group 2erma.burns@test.xx
Jenkins Kristina Group 2kristina.jenkins@test.xx
Todd Catherine Group 2catherine.todd@test.xx
Stanley Douglas Group 2douglas.stanley@test.xx
Graves Claude Group 3claude.graves@test.xx
Arnold Kathy Group 3kathy.arnold@test.xx
Hayes Francis Group 3francis.hayes@test.xx
Hunt Virgil Group 3virgil.hunt@test.xx
Diaz Patti Group 3patti.diaz@test.xx