Hi there,
I am completely lost with a simple MIGXdb configuration.
Schema:
<?xml version="1.0" encoding="UTF-8"?>
<model package="frankcmp" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
<object class="Frankprodukttyp" table="frankprodukttyp" extends="xPDOSimpleObject">
<field key="name" dbtype="varchar" precision="255" phptype="string" null="true" />
<aggregate alias="Frankfiles" class="Frankfiles" local="id" foreign="prodtyp" cardinality="one" owner="foreign" />
</object>
<object class="Frankfiles" table="frankfiles" extends="xPDOSimpleObject">
<field key="name" dbtype="varchar" precision="255" phptype="string" null="true" />
<field key="file" dbtype="varchar" precision="255" phptype="string" null="true" />
<field key="doctype" dbtype="varchar" precision="255" phptype="string" null="true" />
<field key="prodtyp" dbtype="int" precision="11" phptype="integer" null="true" />
<composite alias="Frankprodukttyp" class="Frankprodukttyp" local="prodtyp" foreign="id" cardinality="many" owner="local" />
</object>
</model>
Two MIGX Configurations:
“Product Types”
{
"formtabs":[
{
"MIGX_id":6,
"caption":"Produkttypen",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":24,
"field":"name",
"caption":"Typname",
"description":"z.B. Innent\u00fcr, Rahment\u00fcr",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"text",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":1
},
{
"MIGX_id":31,
"field":"files",
"caption":"Files",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"migxdb",
"validation":"",
"configs":"FrankFiles",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":2
}
],
"pos":1
}
],
"contextmenus":"update||duplicate||remove",
"actionbuttons":"addItem",
"columnbuttons":"",
"filters":"",
"extended":{
"migx_add":"",
"disable_add_item":"",
"add_items_directly":"",
"formcaption":"Frank Typen",
"update_win_title":"Franktypen",
"win_id":"franktypen",
"maxRecords":"",
"addNewItemAt":"bottom",
"media_source_id":4,
"multiple_formtabs":"",
"multiple_formtabs_label":"",
"multiple_formtabs_field":"",
"multiple_formtabs_optionstext":"",
"multiple_formtabs_optionsvalue":"",
"actionbuttonsperrow":4,
"winbuttonslist":"",
"extrahandlers":"",
"filtersperrow":4,
"packageName":"frank",
"classname":"Frankprodukttyp",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"sortconfig":"",
"gridpagesize":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":1,
"check_resid":1,
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"yes",
"getlistwhere":"",
"joins":[
{
"alias":"Frankfiles",
"selectfiles":"id,name"
}
],
"hooksnippets":"",
"cmpmaincaption":"",
"cmptabcaption":"",
"cmptabdescription":"",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":2,
"header":"id",
"dataIndex":"id",
"width":10,
"sortable":true,
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
},
{
"MIGX_id":3,
"dataIndex":"name",
"header":"name"
},
{
"MIGX_id":4,
"header":"Files",
"dataIndex":"files",
"width":250,
"sortable":"false",
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"FrankFiles",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
}
],
"category":""
}
“Product Files”
{
"formtabs":[
{
"MIGX_id":7,
"caption":"Frank Files",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":25,
"field":"id",
"caption":"id",
"pos":1
},
{
"MIGX_id":26,
"field":"name",
"caption":"name",
"pos":2
},
{
"MIGX_id":27,
"field":"file",
"caption":"file",
"pos":3
},
{
"MIGX_id":28,
"field":"doctype",
"caption":"doctype",
"pos":4
},
{
"MIGX_id":29,
"field":"prodtyp",
"caption":"prodtyp",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"number",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"none",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"[[+Franktypen.id]]",
"useDefaultIfEmpty":"0",
"pos":5
},
{
"MIGX_id":30,
"field":"Frankprodukttyp_name",
"caption":"Frankprodukttyp_name",
"pos":6
}
],
"pos":1
}
],
"contextmenus":"update||duplicate||addafter||remove",
"actionbuttons":"addItem",
"columnbuttons":"",
"filters":"",
"extended":{
"migx_add":"",
"disable_add_item":"",
"add_items_directly":"",
"formcaption":"Frank Files",
"update_win_title":"FrankFiles",
"win_id":"frankfiles",
"maxRecords":"",
"addNewItemAt":"bottom",
"media_source_id":4,
"multiple_formtabs":"",
"multiple_formtabs_label":"",
"multiple_formtabs_field":"",
"multiple_formtabs_optionstext":"",
"multiple_formtabs_optionsvalue":"",
"actionbuttonsperrow":4,
"winbuttonslist":"",
"extrahandlers":"",
"filtersperrow":4,
"packageName":"frank",
"classname":"Frankfiles",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"sortconfig":"",
"gridpagesize":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":2,
"check_resid":"0",
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"no",
"getlistwhere":"",
"joins":[
{
"alias":"Frankprodukttyp"
},
{
"selectfields":"name,id"
}
],
"hooksnippets":"",
"cmpmaincaption":"",
"cmptabcaption":"",
"cmptabdescription":"",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":2,
"dataIndex":"id",
"header":"id"
},
{
"MIGX_id":3,
"dataIndex":"name",
"header":"name"
},
{
"MIGX_id":4,
"dataIndex":"file",
"header":"file"
},
{
"MIGX_id":5,
"dataIndex":"doctype",
"header":"doctype"
},
{
"MIGX_id":6,
"dataIndex":"Frankprodukttyp_name",
"header":"Frankprodukttyp_name"
}
],
"category":""
}
I want for “Types”
And for “Files” a list of all files with the type it belongs to:
Problems:
- how to insert the field “prodtyp” automatically with the “id” of the type.
- how to list the files belonging to a type?
Glad for any hint. Thank you.