<![CDATA[ Nested MIGXdb. MIGXdb inside MIGXdb. - My Forums]]> https://forums.modx.com/thread/?thread=79667 <![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=8#dis-post-561910 Quote from: Bruno17 at Oct 04, 2018, 12:29 PM
I'm glad, you got it sorted

Thank you]]>
jimf3000 Oct 04, 2018, 12:52 PM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=8#dis-post-561910
<![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561909 Bruno17 Oct 04, 2018, 12:29 PM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561909 <![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561908 Quote from: jpforsyth at Oct 04, 2018, 12:12 PM
Quote from: jpforsyth at Oct 04, 2018, 11:57 AM
Quote from: Bruno17 at Oct 04, 2018, 11:43 AM
Is there a possibility to have a look into your manager for me?

Hi Bruno,

Thanks for the quick reply smiley

I'm working locally, so the Manager isn't publically accessible.

If you let me know exactly what files/configs you need from me, I can PM. That cool?

Kind regards

Jim

Hi Bruno,

I previously stated that the error occured when trying to update a record, both after clicking [Edit] and/or right-clicking the table row.

Actually, this is incorrect. Sorry.

The error only occurs when right-clicking the table row.

If I render a column using this.renderRowActions, then clicking [Edit] will allow me to edit the record successfully.

Obviously a bug somewhere, but for the purpose of this project, I can continue without issue.

It would be great to understand/identify what's causing the right-click action to make things behave this way.

Kind regards

Jim

Hi Bruno,

Classic. Guess who forgot to add the ID column in their MIGXdb table?

Yep, me. I've now added this and everything works as expected.

Apologies for taking up your time.

Kind regards

Jim]]>
jimf3000 Oct 04, 2018, 12:28 PM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561908
<![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561905 Quote from: jpforsyth at Oct 04, 2018, 11:57 AM
Quote from: Bruno17 at Oct 04, 2018, 11:43 AM
Is there a possibility to have a look into your manager for me?

Hi Bruno,

Thanks for the quick reply smiley

I'm working locally, so the Manager isn't publically accessible.

If you let me know exactly what files/configs you need from me, I can PM. That cool?

Kind regards

Jim

Hi Bruno,

I previously stated that the error occured when trying to update a record, both after clicking [Edit] and/or right-clicking the table row.

Actually, this is incorrect. Sorry.

The error only occurs when right-clicking the table row.

If I render a column using this.renderRowActions, then clicking [Edit] will allow me to edit the record successfully.

Obviously a bug somewhere, but for the purpose of this project, I can continue without issue.

It would be great to understand/identify what's causing the right-click action to make things behave this way.

Kind regards

Jim]]>
jimf3000 Oct 04, 2018, 12:12 PM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561905
<![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561904 Quote from: Bruno17 at Oct 04, 2018, 11:43 AM
Is there a possibility to have a look into your manager for me?

Hi Bruno,

Thanks for the quick reply smiley

I'm working locally, so the Manager isn't publically accessible.

If you let me know exactly what files/configs you need from me, I can PM. That cool?

Kind regards

Jim]]>
jimf3000 Oct 04, 2018, 11:57 AM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561904
<![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561903 Bruno17 Oct 04, 2018, 11:43 AM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561903 <![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561901
Are there any known limitations to the number of allowed nested MIGXdb tables?

I've got 30+ MIGXdb tables, many with single nested MIGXdb tables (these have joins too). All are working great.

When I try nesting a MIGXdb table inside an already nested MIGXdb table, I can successfully do the following:

- Add new item
- See correct columns (including joined aliases)

...but, I'm unable to edit an existing record.

When I click [Edit] or right-click on a table row, the correct input fields are displayed, but none are populated by the correct data, i.e. they're blank and/or selectmenus do not have any option selected etc.

After submiting [Done], the update process returns an error due to the 'object_id' not being set - however a field called 'co_id' (which I'm guessing should be the same as 'object_id') is set correctly. Here's the error (returned from 'processors/default/update.php'). I've simply added a JSON output of $scriptProperties to the error message:

quip.thread_err_ns - missing object_id{"action":"mgr\/migxdb\/update","data":"{\"undefined\":\"\",\"contact\":\"- Please select -\",\"jobtitle\":\"- Please select -\",\"menuindex\":\"\",\"active\":\"\"}","configs":"xtra_event_program_contacts","resource_id":"0","co_id":"5","object_id":"","tv_id":"inp_404_inp_185_1_9_11","wctx":"mgr","tempParams":""}

I would very much appreciate your help to resolve this. Meanwhile, I will keep debugging to see if I can fix this - if I do, I'll post a reply with the steps taken to fix it.

Kind regards

Jim

]]>
jimf3000 Oct 04, 2018, 11:36 AM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-561901
<![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-559083 Quote from: dvstudiosinc at Jan 05, 2014, 03:43 PM
solved my above nested-in-nested issue.

It seems that Check Resource = yes only works if JoinAlias is used. Using a JSON value in Join field causes an error (resource_id can't be found).


Did you ever get this to work? I am trying to do almost exactly what you are trying to do (but with a project manager tool) and I am getting the same results. everything ~pretty much~ works, but when I click on the image tab it will load all the images in the image table, the id (mycase project_id, your case prodid) from the parent table is not being associated/pulled into the images table.
I cut/pasted your schema & configs into my dev environment & got exactly the same problem.

How did you resolve this?]]>
sean69 Jun 14, 2018, 03:18 PM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-559083
<![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-486543
It seems that Check Resource = yes only works if JoinAlias is used. Using a JSON value in Join field causes an error (resource_id can't be found).

]]>
dvstudiosinc Jan 05, 2014, 03:43 PM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-486543
<![CDATA[Re: Nested MIGXdb. MIGXdb inside MIGXdb.]]> https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-486519
I am nesting a migxdb grid that links to an "Images" table from the parent "Products" table. Essentially, I need the id from the parent product to be recorded into the IMage record (one-to-many from Products to Images). I can get the image grid to display, but it is showing ALL records in the image table. Furthermore, when I add an image, it doesn't record the current product record id into the Images table.

Here is the Schema
<?xml version="1.0" encoding="UTF-8"?>
<model package="productcatalog" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
        <object class="Catalog" table="prod_catalog" extends="xPDOSimpleObject" >
<field key="prodno" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="description" dbtype="text" phptype="string" />
<field key="classid" dbtype="text" phptype="string"/>
        <field key="prodname" dbtype="text" phptype="string" null="false" default="" />
        <field key="specifications" dbtype="text" phptype="json" null="false" default="" />
 <field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="createdby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="createdon" dbtype="datetime" phptype="datetime" null="false" />
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
                <column key="id" collation="A" null="false" />
        </index>
        <aggregate alias="Creator" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign" />
<aggregate alias="ProductCategory" class="ProdClass" local="classid" foreign="id" cardinality="one" owner="foreign" />
<composite alias="Images" class="ProdImg" local="id" foreign="prodid" cardinality="many" owner="local"/>
        </object>
	<object class="ProdImg" table="prod_images" extends="xPDOSimpleObject" >
        <field key="description" dbtype="text" phptype="string" />
        <field key="imgpath" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<field key="prodid" dbtype="int" precision="50" phptype="integer" null="false" default="0" />
        <field key="createdby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="createdon" dbtype="datetime" phptype="datetime" null="false" />
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
                <column key="id" collation="A" null="false" />
        </index>
        <aggregate alias="Creator" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign" />
<aggregate alias="Product" class="Catalog" local="prodid" foreign="id" cardinality="one" owner="foreign" />
        </object>
	<object class="ProdClass" table="prod_classes" extends="xPDOSimpleObject" >
        <field key="classname" dbtype="varchar" precision="255" phptype="string" />
<field key="classimg" dbtype="text" phptype="string" />
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
                <column key="id" collation="A" null="false" />
        </index>
        </object>
</model>


and here is the config for the parent (Catalog) CMP:
{
  "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":4,
          "field":"classid",
          "caption":"Category",
          "description":"",
          "description_is_code":"0",
          "inputTV":"ProductCategories",
          "inputTVtype":"",
          "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":"migx",
          "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":[
      {
        "classname":"ProdClass",
        "alias":"ProductCategory",
        "on":"ProductCategory.id=classid"
      }
    ],
    "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":50,
      "sortable":true,
      "show_in_grid":1,
      "renderer":"",
      "clickaction":"selectFromGrid",
      "selectorconfig":"",
      "renderchunktpl":"",
      "renderoptions":"[]"
    },
    {
      "MIGX_id":3,
      "header":"Name",
      "dataIndex":"prodname",
      "width":500,
      "sortable":true,
      "show_in_grid":1,
      "renderer":"",
      "clickaction":"",
      "selectorconfig":"",
      "renderchunktpl":"",
      "renderoptions":"[]"
    },
    {
      "MIGX_id":4,
      "header":"Classification",
      "dataIndex":"ProductCategory_classname",
      "width":"",
      "sortable":true,
      "show_in_grid":1,
      "renderer":"",
      "clickaction":"",
      "selectorconfig":"",
      "renderchunktpl":"",
      "renderoptions":"[]"
    }
  ]
}


and for the Images (ProdImg) CMP
{
  "formtabs":[
    {
      "MIGX_id":1,
      "caption":"Images",
      "print_before_tabs":"0",
      "fields":[
        {
          "MIGX_id":1,
          "field":"imgpath",
          "caption":"Image",
          "description":"",
          "description_is_code":"0",
          "inputTV":"",
          "inputTVtype":"image",
          "configs":"",
          "sourceFrom":"config",
          "sources":"[]",
          "inputOptionValues":"",
          "default":""
        }
      ]
    }
  ],
  "contextmenus":"update||recall_remove_delete||remove||remove_migx",
  "actionbuttons":"addItem||bulk",
  "columnbuttons":"update||deactivate||recall_remove_delete||remove||remove_migx",
  "filters":"[]",
  "extended":{
    "migx_add":"Add Image",
    "formcaption":"",
    "update_win_title":"",
    "win_id":"ProductImages",
    "maxRecords":"",
    "addNewItemAt":"top",
    "multiple_formtabs":"",
    "extrahandlers":"",
    "packageName":"productcatalog",
    "classname":"ProdImg",
    "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":[
      {
        "alias":"Product"
      }
    ],
    "cmpmaincaption":"",
    "cmptabcaption":"",
    "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":"Image",
      "dataIndex":"imgpath",
      "width":"",
      "sortable":"false",
      "show_in_grid":1,
      "renderer":"this.renderImage",
      "clickaction":"",
      "selectorconfig":"",
      "renderchunktpl":"",
      "renderoptions":"[]"
    },
    {
      "MIGX_id":3,
      "header":"prodid",
      "dataIndex":"prodid",
      "width":"",
      "sortable":"false",
      "show_in_grid":"0",
      "renderer":"",
      "clickaction":"",
      "selectorconfig":"",
      "renderchunktpl":"",
      "renderoptions":"[]"
    }
  ]
}


Where am I missing a configuration to pull the current product id and put it in the Images table, as well as how do I build the where clause to only display grid results for the currently loaded product?]]>
dvstudiosinc Jan 05, 2014, 08:33 AM https://forums.modx.com/thread/79667/nested-migxdb-migxdb-inside-migxdb?page=7#dis-post-486519