Hopping into this thread with a different wrinkle that I MUST be missing something basic.
I need to put a grid in a form tab, the data of which will be saved as a JSON string into a field ("specifications") of the Parent Class ("Catalog").
I assumed that I would create a new MIGXdb config for this ("productspecs") and just point this new config to the Catalog class. Doing this creates a new record instead of adding the data to the current record.
here are the configs to the Parent MIGX Config:
{
"formtabs":[
{
"MIGX_id":1,
"caption":"General",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":1,
"field":"prodno",
"caption":"Product Number",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"text",
"configs":"",
"sourceFrom":"config",
"sources":"[]",
"inputOptionValues":"",
"default":""
},
{
"MIGX_id":2,
"field":"prodname",
"caption":"Product Name",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"text",
"configs":"",
"sourceFrom":"config",
"sources":"[]",
"inputOptionValues":"",
"default":""
},
{
"MIGX_id":3,
"field":"description",
"caption":"Description",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"richtext",
"configs":"",
"sourceFrom":"config",
"sources":"[]",
"inputOptionValues":"",
"default":""
}
]
},
{
"MIGX_id":2,
"caption":"Specifications",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":1,
"field":"specifications",
"caption":"Specifications",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"migxdb",
"configs":"productspecs",
"sourceFrom":"config",
"sources":"[]",
"inputOptionValues":"",
"default":""
}
]
},
{
"MIGX_id":3,
"caption":"Images",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":2,
"field":"images",
"caption":"",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"migxdb",
"configs":"productimages",
"sourceFrom":"config",
"sources":"[]",
"inputOptionValues":"",
"default":""
}
]
}
],
"contextmenus":"update||duplicate||activate||deactivate||recall_remove_delete||remove",
"actionbuttons":"addItem||bulk",
"columnbuttons":"",
"filters":"[]",
"extended":{
"migx_add":"",
"formcaption":"Manage the catalog products in the grid below",
"update_win_title":"Product Catalog",
"win_id":"productcatalog",
"maxRecords":"",
"addNewItemAt":"top",
"multiple_formtabs":"",
"extrahandlers":"",
"packageName":"productcatalog",
"classname":"Catalog",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":1,
"check_resid":1,
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"yes",
"getlistwhere":"",
"joins":"",
"cmpmaincaption":"Product Catalog",
"cmptabcaption":"Products",
"cmptabdescription":" ",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":1,
"header":"ID",
"dataIndex":"id",
"width":"",
"sortable":"false",
"show_in_grid":"0",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"[]"
},
{
"MIGX_id":2,
"header":"Product No",
"dataIndex":"prodno",
"width":150,
"sortable":true,
"show_in_grid":1,
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"[]"
},
{
"MIGX_id":3,
"header":"Name",
"dataIndex":"prodname",
"width":"",
"sortable":true,
"show_in_grid":1,
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"[]"
}
]
}
and the configs for the productspecs config
{
"formtabs":[
{
"MIGX_id":1,
"caption":"Add Specification",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":1,
"field":"specifications.name",
"caption":"Name",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"text",
"configs":"",
"sourceFrom":"config",
"sources":"[]",
"inputOptionValues":"",
"default":""
},
{
"MIGX_id":2,
"field":"specifications.value",
"caption":"Value",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"text",
"configs":"",
"sourceFrom":"config",
"sources":"[]",
"inputOptionValues":"",
"default":""
}
]
}
],
"contextmenus":"update||duplicate||recall_remove_delete",
"actionbuttons":"addItem",
"columnbuttons":"",
"filters":"[]",
"extended":{
"migx_add":"",
"formcaption":"",
"update_win_title":"",
"win_id":"productspecs",
"maxRecords":"",
"addNewItemAt":"bottom",
"multiple_formtabs":"",
"extrahandlers":"",
"packageName":"productcatalog",
"classname":"Catalog",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":2,
"check_resid":1,
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"yes",
"getlistwhere":"",
"joins":"",
"cmpmaincaption":"",
"cmptabcaption":"",
"cmptabdescription":"",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":1,
"header":"Name",
"dataIndex":"specifications.name",
"width":"",
"sortable":true,
"show_in_grid":1,
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"[]"
},
{
"MIGX_id":2,
"header":"Value",
"dataIndex":"specifications.value",
"width":"",
"sortable":true,
"show_in_grid":1,
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"[]"
}
]
}
(Disregard the ProductImages reference... I have that part working since ProductImages is a separate table/Class)
My intended result from an update action is to have the currently loaded record ("product") have its specifications field updated with a JSON string. When I do the record update, it creates a new entry with everything blank EXCEPT the specifications field (which is populated as expected).
What piece of config am I missing?