Flying through MIGXDB now and I love it, however hit a small hurdle that I am hoping some kind soul can help me with.
I have two tables, a "
teams" table (id and name) and a "
rosters" table (id, name, teamId e.t.c)
In my
rosters table, I want to via a formtabs selectable option, select the
name from the
teams table, save the
name id to the
rosters table, yet render to the user the name.
I hope this makes sense.
My scheme file for teams is...
<?xml version="1.0" encoding="UTF-8"?>
<model package="teams" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
<object class="Team" table="teams" extends="xPDOSimpleObject" >
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
</model>
And a snippet from my rosters is ...
<?xml version="1.0" encoding="UTF-8"?>
<model package="rosters" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
<object class="Roster" table="rosters" extends="xPDOSimpleObject">
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="teamId" dbtype="tinyint" precision="3" attributes="unsigned" phptype="integer" null="false" />
<aggregate alias="teamName" class="Team" local="teamId" foreign="id" cardinality="one" owner="foreign" />
</object>
</model>
EDIT :
I have since looked at this post...
https://forums.modx.com/thread/80596/migxdb-cmp-how-to-display-value-from-other-table-in-column
I have put the following into my MIGX config on the joins table
I have also put Team_name in the formlist selectable with a TV type of "dropdown" but it still doesnt show me any data, and still renders as a text field
[ed. note: gelstudios last edited this post 13 years, 6 months ago.]