I simply want to
fill up the migx grid with resources from a specific parent, filtered by a where "myTV==$modx->resource->get('id')". In other words, return all "other resources" where a TV value matches the ID of the current resource.
The migx grid would contain the title, desc & imageTV of the resources matching the above.
With this result, the
user would not only be able to have an overview of the related resources, but he would also be able to manage the order using drag & drop (in my case, 100's of items).
From this user ordered migx grid, I would
output a list of sorted ID's which I can then return to getRecources or whatever to generate a front-end list.
Tricky part: such a "refresh" or "load" button isn't allowed to empty & refill the contents of the entire grid because that way you would lose the manually ordered list. It would only be allowed to add or remove options for sorting whilst keeping the current order. (New items -> added at the bottom, Removed items -> deleted from the grid).
Currently I've managed to do something similar using the "Checkbox sortable TV type":
TV: input type "Checkbox sortable".
Input options: @EVAL return $modx->runSnippet('theSnippetBlow');
<?php
$myFilter = 'veiling==='. $modx->resource->get('id');
$list = $modx->runSnippet('getResources', array(
'parents'=>'62',
'tpl'=>'snippetWithPagetitleAndID',
'includeContent'=>'0',
'includeTVs'=>'1',
'depth'=>'3',
'showHidden'=>'1',
'limit'=>'1000',
'where' => '{"template:=":2}',
'sortby' => '{"pagetitle":"ASC"}',
'tvFilters' => $myFilter,
'outputSeparator' => '||'
));
return $list;
Which results in the attached screenshot. It does perfectly what I need it to (it also keeps the order of the items when values are added or removed), unfortunately te "checkbox sortable" TV type cannot display more columns of specific info, for which migx would be perfect.
I hope this is at all possible with migx?