We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46315
    • 30 Posts
    hello

    I've created a simple package through migx using a custom table. 3 fields: "name", "label" and coords. Entering the values through a CMP works as expected but when it comes to editing the existing values of an entry the formtab doesn't load the values, I'm just left with blank fields.

    Setup:
    MODX Revolution 2.3.3
    MIGX migx-2.9.3-pl

    This question has been answered by Bruno17. See the first response.

      • 4172
      • 5,888 Posts
      We could check your setup, if you would post your xpdo-schema and your exported MIGX-config.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 46315
        • 30 Posts
        Quote from: Bruno17 at May 06, 2015, 10:39 AM
        We could check your setup, if you would post your xpdo-schema and your exported MIGX-config.

        Thanks Bruno17

        Schema:

        <?xml version="1.0" encoding="UTF-8"?>
        <model package="mapsearch" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
            <object class="Mapsearch" table="mapsearch_props" extends="xPDOSimpleObject">
                <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
        		<field key="label" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
        		<field key="coords" dbtype="varchar" precision="255" phptype="string" 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"/>
            </object>
        </model>


        Json:

        {
          "formtabs":[
            {
              "MIGX_id":1,
              "caption":"Location",
              "print_before_tabs":"0",
              "fields":[
                {
                  "MIGX_id":1,
                  "field":"name",
                  "caption":"Name:",
                  "description":"please use lowercase characters and replace spaces with underscores eg. \"puerto_banus\" ",
                  "description_is_code":"0",
                  "inputTV":"",
                  "inputTVtype":"",
                  "validation":"required",
                  "configs":"",
                  "restrictive_condition":"",
                  "display":"",
                  "sourceFrom":"config",
                  "sources":"",
                  "inputOptionValues":"",
                  "default":"",
                  "useDefaultIfEmpty":"0",
                  "pos":1
                },
                {
                  "MIGX_id":2,
                  "field":"label",
                  "caption":"Label",
                  "description":"",
                  "description_is_code":"0",
                  "inputTV":"",
                  "inputTVtype":"",
                  "validation":"",
                  "configs":"",
                  "restrictive_condition":"",
                  "display":"",
                  "sourceFrom":"config",
                  "sources":"",
                  "inputOptionValues":"",
                  "default":"",
                  "useDefaultIfEmpty":"0",
                  "pos":2
                },
                {
                  "MIGX_id":3,
                  "field":"coords",
                  "caption":"Co-ordinates",
                  "description":"",
                  "description_is_code":"0",
                  "inputTV":"",
                  "inputTVtype":"",
                  "validation":"",
                  "configs":"",
                  "restrictive_condition":"",
                  "display":"",
                  "sourceFrom":"config",
                  "sources":"",
                  "inputOptionValues":"",
                  "default":"",
                  "useDefaultIfEmpty":"0",
                  "pos":3
                }
              ],
              "pos":1
            }
          ],
          "contextmenus":"update||unpublish||activate||recall_remove_delete",
          "actionbuttons":"addItem||bulk||toggletrash",
          "columnbuttons":"update",
          "filters":[
            {
              "MIGX_id":1,
              "name":"search",
              "label":"Search Label.",
              "emptytext":"",
              "type":"textbox",
              "getlistwhere":{
                "label:LIKE":"%[[+search]]%"
              },
              "getcomboprocessor":"",
              "combotextfield":"",
              "comboidfield":"",
              "comboparent":"",
              "default":""
            }
          ],
          "extended":{
            "migx_add":"Add Item",
            "disable_add_item":"",
            "add_items_directly":"",
            "formcaption":"Map Search Locations",
            "update_win_title":"Map Search Locations",
            "win_id":"mapsearch",
            "maxRecords":"",
            "addNewItemAt":"bottom",
            "multiple_formtabs":"",
            "multiple_formtabs_label":"",
            "multiple_formtabs_field":"",
            "multiple_formtabs_optionstext":"",
            "multiple_formtabs_optionsvalue":"",
            "actionbuttonsperrow":4,
            "winbuttonslist":"",
            "extrahandlers":"gridfilter||this.addItem||this.update||this.handleColumnSwitch",
            "filtersperrow":4,
            "packageName":"mapsearch",
            "classname":"Mapsearch",
            "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":"",
            "hooksnippets":"",
            "cmpmaincaption":"Map Locations",
            "cmptabcaption":"Locations",
            "cmptabdescription":"Please add your location here",
            "cmptabcontroller":"",
            "winbuttons":"",
            "onsubmitsuccess":"",
            "submitparams":""
          },
          "columns":[
            {
              "MIGX_id":1,
              "header":"Name",
              "dataIndex":"name",
              "width":"",
              "sortable":"false",
              "show_in_grid":1,
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":2,
              "header":"Label",
              "dataIndex":"label",
              "width":"",
              "sortable":"false",
              "show_in_grid":1,
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":3,
              "header":"Co-ordinates",
              "dataIndex":"coords",
              "width":"",
              "sortable":"false",
              "show_in_grid":1,
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":4,
              "header":"Published",
              "dataIndex":"published",
              "width":"",
              "sortable":"false",
              "show_in_grid":1,
              "renderer":"this.renderSwitchStatusOptions",
              "clickaction":"switchOption",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":[
                {
                  "MIGX_id":1,
                  "name":"published",
                  "use_as_fallback":"",
                  "value":1,
                  "clickaction":"",
                  "handler":"",
                  "image":"assets\/components\/migx\/style\/images\/tick.png"
                },
                {
                  "MIGX_id":2,
                  "name":"unpublish",
                  "use_as_fallback":"",
                  "value":"0",
                  "clickaction":"",
                  "handler":"",
                  "image":"assets\/components\/migx\/style\/images\/cross.png"
                }
              ],
              "editor":""
            }
          ]
        }


        Kind regards
        • discuss.answer
          • 4172
          • 5,888 Posts
          You need to add the id-field to the columns. This can be hidden from grid.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 46315
            • 30 Posts
            You're a legend! Many Thanks Bruno smiley
              • 46315
              • 30 Posts
              You're a legend! Many Thanks Bruno smiley