This question has been answered by Bruno17. See the first response.
I want the projects field to be a single select listbox that contains the client_name of each row in the clients table.
@EVAL return 'choose one==||'.$modx->runSnippet('migxLoopCollection',array('packageName'=>'YourPackage','classname'=>'YourClassname','tpl'=>'@CODE:[[+id]]==[[+client_name]]','outputSeparator'=>'||','sortConfig'=>'[{"sortby":"client_name"}]'));
choose one==||
[[migxLoopCollection?
&packageName=`YourPackage`
&classname=`YourClassname`
&tpl=`@CODE:[[+id]]==[[+client_name]]`
&outputSeparator=`||`
&sortConfig=`[{"sortby":"client_name"}]`
]]
@CHUNK yourChunkName
Also I'd like to be able to have a migx grid within a migxdb table to enter multiple images, like a gallery, in a field.
<?php
$img = '<img src="{0}" alt="{1}" title="{2}">';
$renderer['this.renderHasIt'] = "
renderHasIt : function(val, md, rec, row, col, s) {
var renderImage, altText, handler, classname;
switch (val) {
case 0:
case '0':
case false:
renderImage = '/assets/components/migx/style/images/cross.png';
handler = '';
classname = 'publish';
altText = 'No';
break;
case 1:
case '1':
case true:
renderImage = '/assets/components/migx/style/images/tick.png';
handler != '';
classname = 'unpublish';
altText = 'Yes';
break;
}
return String.format('{$img}', renderImage, altText, altText, classname, handler);
}
";<tr>
<td>[[+createdon]]</td>
<td>
<table>
<tr>
<td>[[+notes]]</td>
</tr>
<tr>
<td>
[[migx +images output?]]
</td>
</tr>
</table>
</td>
</tr>[[+_this.value:is=``:then=` <img src="/assets/components/migx/style/images/cross.png"> `:else=` <img src="/assets/components/migx/style/images/tick.png"> `]]
[[+_this.value]]
<tr>
<td>[[+createdon]]</td>
<td>
<table>
<tr>
<td>[[+notes]]</td>
</tr>
<tr>
<td>
[[getImageList? &value=`[[+images]]` &tpl=`imageTpl`]]
</td>
</tr>
</table>
</td>
</tr>[[+comment]]
[[!migxLoopCollection? &packageName=`notes` &classname=`notes` &where=`{"project:=":"[[!+comment]]"}` &tpl=`notesInner`]]