I have a listbox type formtab working just fine, it adds/edits etc from the popup form:
{
"MIGX_id":52,
"field":"category",
"caption":"Category",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"listbox",
"validation":"required",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"@EVAL return 'Choose Category==||' . $modx->runSnippet('migxLoopCollection',array('packageName'=>'projects','classname'=>'ProjectCategory','tpl'=>'@CODE:[[+category]]==[[+id]]','outputSeparator'=>'||'));",
"default":"",
"useDefaultIfEmpty":"0",
"pos":3
},
So you can see it's getting it's options from a database table:
<object class="ProjectCategory" table="bigblock_project_category" extends="xPDOSimpleObject">
<field key="category" dbtype="char" precision="50" phptype="string" null="false" />
<field key="sort" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
<aggregate alias="Project" class="Project" local="id" foreign="category" cardinality="many" owner="local" default="0" />
</object>
this works great - shows the options - everything is happy.
Now, I found a couple articles & posts on how to render the name of the category (rather than it's id) in the migx grid view column, seems straight forward.
HOWEVER:
I need the Category in the grid column view to be a listbox (select field) that is editable from the grid.
How is that done?
**UPDATE**
So somehow this is now "kind of" working if I use the joined class_field as the column field name, and it shows the category name in the grid view - great... HOWEVER, if I click/double click on the item the drop down list is blank. If I change "dataIndex":"ProjectCategory_category", to "dataIndex":"category", the drop down list is correctly populated AND I can change/edit the items (and verify they are correct in the database)
{
"MIGX_id":13,
"header":"Project Category",
"dataIndex":"ProjectCategory_category",
"width":"",
"sortable":true,
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"switchOption",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":"this.listboxEditor"
},
So one step further, all I need now is to know how to render the category name correctly AND have the listbox correctly populated.
[ed. note: sean69 last edited this post 6 years, 9 months ago.]