We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    this field is normally used, if you want to connect table-records to resources.
    There is now a new setting 'has_jointable' which fixes the error, you are getting, when using the default-processors, if you don't have a join-table, which connects records to resources.

    This setting is currently only added in the github-version of MIGX.
    As soon as I have a bit more time, I will upload it to the repo.
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 24414
      • 45 Posts
      So if I wanted to create a resource for each record this would be used there? That is part of what I want to do with this in the end too.

      More reading and fiddling!
        • 4172
        • 5,888 Posts
        what is the reason, you want to create a resource for each project?
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 24414
          • 45 Posts
          Yes, that is the aim (for some uses I am looking at for it).

          I've looked over the tutorials on rtfm but not looked too deeply as I have been trying to get my head round this bit first! So now it is to get my head round front end display.

          I would like to run it as a TV in a parent resource that shows a listing on the front end and have child resources sitting below for detail display.
            • 4172
            • 5,888 Posts
            normally it should be enough to have one resource for the listing and another one for the details-view.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 24414
              • 45 Posts
              Ah, I think I am just explaining myself badly! That is what I meant.

              I am looking for display of items on the front end as if they were any other resource that sits in the tree, just dealing with the data in the grid. Very much like Articles works.
                • 4172
                • 5,888 Posts
                On your listing-resource, you can use migxLoopCollection

                [[migxLoopCollection? &packageName=`yourpackage` &classname=`yourclassname` &tpl=`projectListTpl`]]


                have a Link to your detals-resource with:

                <a href="[[~yourDetailsID? &objectID=`[[+id]]`]]">[[+project]]</a>

                on the details-page:
                [[migxLoopCollection? 
                  &packageName=`yourpackage` 
                  &classname=`yourclassname` 
                  &tpl=`projectDetailsTpl` 
                  &where=`{"id":"[[!getReqParam? &name=`objectID`]]"}`
                ]]



                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 24414
                  • 45 Posts
                  Thank you very much!

                  I will have a play tonight and create another thread with the inevitable questions to avoid derailing this one further. =D

                  I am very excited about the possibilities of MIGXdb. I have used MIGX for a while but been a bit wary of playing more deeply and the xPDO side of things. Now I can see so many great things to do with it. Thank you again for this amazing tool =)
                  • Hey Bruno - sorry to bug you for help, but I can't seem to figure this one out...

                    I'm creating my first MIGXdb package and I'm loving it - I've got my schema parsed and my tables created and a basic CMP up in a tiny fraction of the time it would take to code it by hand. This is an awesome tool!

                    But I can't seem to get nested MIGXdb grids as described in this thread to work. I have parent and child objects set up, and a simple test config for each one. Both configs work on their own.

                    However, if I try to add a migxdb field to the parent formtabs to add and list children, I can't get the edit/create box for the parent to come up. When I click "create" or "edit" on the parent grid, it pops up a box and just says loading... indefinitely, and never loads the formtabs. Without the migxdb field, it comes up fine and I'm able to create both parent and child objects.

                    Here are my schema and configs. This is a form manager, so the parent object is a form, which can have many fields (and each field can have validation and skip rules, but I haven't got to the interface for that yet).

                    Here are the relevant parts of the schema:

                        <object class="efForm" table="ef_forms" extends="xPDOSimpleObject">
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="cta" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="header" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="formid" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="channel" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="emailField" dbtype="int" precision="11" phptype="integer" null="true" />
                            <field key="honeytoken" dbtype="int" precision="11" phptype="integer" null="true" />
                            <field key="channelField" dbtype="int" precision="11" phptype="integer" null="true" />
                            <field key="answer" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="formcode" dbtype="text" phptype="string" />
                            <field key="jscode" dbtype="text" phptype="string" />
                            <field key="extended" dbtype="text" phptype="json" null="false" default="" />
                            <field key="elqDLKey_Cookie" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="elqDLKey_Email" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="openQuestions" dbtype="int" precision="11" phptype="integer" null="true" />
                            <field key="fixedQuestions" dbtype="int" precision="11" phptype="integer" null="true" />
                            <field key="createdon" dbtype="datetime" phptype="datetime" null="true"/>
                            <field key="createdby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="editedon" dbtype="datetime" phptype="datetime" null="true"/>
                            <field key="editedby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" /> 
                            <aggregate alias="CreatedBy" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign"/>
                            <aggregate alias="EditedBy" class="modUser" local="editedby" foreign="id" cardinality="one" owner="foreign"/>
                            <composite alias="Field" class="efField" local="id" foreign="form" cardinality="many" owner="local" />
                            <composite alias="Contact" class="efContact" local="id" foreign="form" cardinality="many" owner="local" />
                            <index alias="name" name="name" primary="false" unique="false" type="BTREE">
                                <column key="name" length="" collation="A" null="false" />
                            </index>
                            <index alias="formid" name="formid" primary="false" unique="false" type="BTREE">
                                <column key="formid" length="" collation="A" null="false" />
                            </index>
                        </object>
                        
                        <object class="efField" table="ef_fields" extends="xPDOSimpleObject">
                            <field key="form" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="dbname" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="type" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="prepop" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="htmlId" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                            <field key="attributes" dbtype="text" phptype="string" />
                            <field key="value" dbtype="text" phptype="string" />
                            <field key="question" dbtype="text" phptype="string" />
                            <field key="subtext" dbtype="text" phptype="string" />
                            <field key="extended" dbtype="text" phptype="json" null="false" default="" />
                            <field key="createdon" dbtype="datetime" phptype="datetime" null="true"/>
                            <field key="createdby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="editedon" dbtype="datetime" phptype="datetime" null="true"/>
                            <field key="editedby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                            <field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" /> 
                            <aggregate alias="CreatedBy" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign"/>
                            <aggregate alias="EditedBy" class="modUser" local="editedby" foreign="id" cardinality="one" owner="foreign"/>
                            <aggregate alias="Form" class="efForm" local="form" foreign="id" cardinality="one" owner="foreign" />
                            <composite alias="validationRules" class="efValidationRule" local="id" foreign="field" cardinality="many" owner="local" />
                            <composite alias="skipRules" class="efSkipRule" local="id" foreign="field" cardinality="many" owner="local" />
                            <index alias="form" name="form" primary="false" unique="false" type="BTREE">
                                <column key="form" length="" collation="A" null="false" />
                            </index>
                        </object>
                        
                      
                    


                    The relevant parts of the parent config:

                        {
                    "formtabs":"[
                        {
                    	"MIGX_id":"1",
                    	"caption":"Form",
                    	"fields":[
                    	    {
                    			"MIGX_id":"1",
                    			"field":"name",
                    			"caption":"Name",
                    			"inputTV":"",
                    			"inputTVtype":"",
                    			"configs":"",
                    			"sourceFrom":"config",
                    			"sources":"",
                    			"inputOptionValues":"",
                    			"default":""
                    		},
                    	    {
                    			"MIGX_id":"2",
                    			"field":"description",
                    			"caption":"Description",
                    			"inputTV":"",
                    			"inputTVtype":"textarea",
                    			"configs":"",
                    			"sourceFrom":"config",
                    			"sources":"",
                    			"inputOptionValues":"",
                    			"default":""
                    		}]
                    	},
                        {
                    	"MIGX_id":"2",
                    	"caption":"Fields",
                    	"fields":[
                    	    {
                    			"MIGX_id":"3",
                    			"field":"fields",
                    			"caption":"fields",
                    			"inputTV":"",
                    			"inputTVtype":"migxdb",
                    			"configs":"effields",
                    			"sourceFrom":"config",
                    			"sources":"[]",
                    			"inputOptionValues":"",
                    			"default":""
                    		}
                    	]
                    }
                    
                    


                    And the relevant parts of the child config (called effields):

                    "extended":{
                    	"migx_add":"Add Field",
                    	"formcaption":"",
                    	"win_id":"effields",
                    	"multiple_formtabs":"",
                    	"packageName":"eloquaforms",
                    	"classname":"efField",
                    	"task":"",
                    	"getlistsort":"",
                    	"getlistsortdir":"",
                    	"use_custom_prefix":"0",
                    	"prefix":"",
                    	"grid":"",
                    	"gridload_mode":"1",
                    	"check_resid":"1",
                    	"check_resid_TV":"",
                    	"join_alias":"Form",
                    	"getlistwhere":"",
                    	"joins":"",
                    	"cmpmaincaption":"",
                    	"cmptabcaption":"Fields",
                    	"cmptabdescription":"Manage your form fields here. You can edit them by either double-clicking on the grid or right-clicking on the respective row.",
                    	"cmptabcontroller":""
                    },
                    


                    Any ideas why it won't load?
                      • 4172
                      • 5,888 Posts
                      hmm...

                      I have it working (with the latest version on github) and this configs:

                      {
                        "formtabs":[
                          {
                            "MIGX_id":1,
                            "caption":"Form",
                            "fields":[
                              {
                                "MIGX_id":1,
                                "field":"name",
                                "caption":"Name",
                                "inputTV":"",
                                "inputTVtype":"",
                                "configs":"",
                                "sourceFrom":"config",
                                "sources":"",
                                "inputOptionValues":"",
                                "default":""
                              },
                              {
                                "MIGX_id":2,
                                "field":"description",
                                "caption":"Description",
                                "inputTV":"",
                                "inputTVtype":"textarea",
                                "configs":"",
                                "sourceFrom":"config",
                                "sources":"",
                                "inputOptionValues":"",
                                "default":""
                              }
                            ]
                          },
                          {
                            "MIGX_id":2,
                            "caption":"Fields",
                            "print_before_tabs":"0",
                            "fields":[
                              {
                                "MIGX_id":3,
                                "field":"fields",
                                "caption":"fields",
                                "description":"",
                                "description_is_code":"0",
                                "inputTV":"",
                                "inputTVtype":"migxdb",
                                "configs":"effields",
                                "sourceFrom":"config",
                                "sources":"[]",
                                "inputOptionValues":"",
                                "default":""
                              }
                            ]
                          }
                        ],
                        "contextmenus":"update",
                        "actionbuttons":"addItem",
                        "columnbuttons":"",
                        "filters":"[]",
                        "extended":{
                          "migx_add":"",
                          "formcaption":"",
                          "update_win_title":"",
                          "win_id":"efForm",
                          "maxRecords":"",
                          "multiple_formtabs":"",
                          "extrahandlers":"",
                          "packageName":"eloquaforms",
                          "classname":"efForm",
                          "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":"",
                          "cmptabcaption":"",
                          "cmptabdescription":"",
                          "cmptabcontroller":"",
                          "winbuttons":"",
                          "onsubmitsuccess":"",
                          "submitparams":""
                        },
                        "columns":[
                          {
                            "MIGX_id":1,
                            "header":"ID",
                            "dataIndex":"id",
                            "width":"",
                            "sortable":"false",
                            "show_in_grid":1,
                            "renderer":"",
                            "clickaction":"",
                            "selectorconfig":"",
                            "renderoptions":"[]"
                          },
                          {
                            "MIGX_id":2,
                            "header":"Name",
                            "dataIndex":"name",
                            "width":"",
                            "sortable":"false",
                            "show_in_grid":1,
                            "renderer":"",
                            "clickaction":"",
                            "selectorconfig":"",
                            "renderoptions":"[]"
                          }
                        ]
                      }
                      


                      {
                        "formtabs":[
                          {
                            "MIGX_id":1,
                            "caption":"Field",
                            "print_before_tabs":"0",
                            "fields":[
                              {
                                "MIGX_id":1,
                                "field":"name",
                                "caption":"Name",
                                "description":"",
                                "description_is_code":"0",
                                "inputTV":"",
                                "inputTVtype":"",
                                "configs":"",
                                "sourceFrom":"config",
                                "sources":"[]",
                                "inputOptionValues":"",
                                "default":""
                              }
                            ]
                          }
                        ],
                        "contextmenus":"update",
                        "actionbuttons":"addItem",
                        "columnbuttons":"",
                        "filters":"[]",
                        "extended":{
                          "migx_add":"Add Field",
                          "formcaption":"",
                          "update_win_title":"",
                          "win_id":"effields",
                          "maxRecords":"",
                          "multiple_formtabs":"",
                          "extrahandlers":"",
                          "packageName":"eloquaforms",
                          "classname":"efField",
                          "task":"",
                          "getlistsort":"",
                          "getlistsortdir":"",
                          "use_custom_prefix":"0",
                          "prefix":"",
                          "grid":"",
                          "gridload_mode":2,
                          "check_resid":1,
                          "check_resid_TV":"",
                          "join_alias":"Form",
                          "has_jointable":"no",
                          "getlistwhere":"",
                          "joins":"",
                          "cmpmaincaption":"",
                          "cmptabcaption":"Fields",
                          "cmptabdescription":"Manage your form fields here. You can edit them by either double-clicking on the grid or right-clicking on the respective row.",
                          "cmptabcontroller":"",
                          "winbuttons":"",
                          "onsubmitsuccess":"",
                          "submitparams":""
                        },
                        "columns":[
                          {
                            "MIGX_id":1,
                            "header":"ID",
                            "dataIndex":"id",
                            "width":"",
                            "sortable":"false",
                            "show_in_grid":1,
                            "renderer":"",
                            "clickaction":"",
                            "selectorconfig":"",
                            "renderoptions":"[]"
                          },
                          {
                            "MIGX_id":2,
                            "header":"Form",
                            "dataIndex":"form",
                            "width":"",
                            "sortable":"false",
                            "show_in_grid":1,
                            "renderer":"",
                            "clickaction":"",
                            "selectorconfig":"",
                            "renderoptions":"[]"
                          },
                          {
                            "MIGX_id":3,
                            "header":"Name",
                            "dataIndex":"name",
                            "width":"",
                            "sortable":"false",
                            "show_in_grid":1,
                            "renderer":"",
                            "clickaction":"",
                            "selectorconfig":"",
                            "renderoptions":"[]"
                          }
                        ]
                      }
                      
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!