We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40041
    • 36 Posts
    I need a little help as the title points out. I can't find any documentation on this unfortunately but hopefully this is known by someone.

    I have a custom table (xx_downloads - note the non modx prefix) where I log downloads of my site members.
    it contains four columns: (id, user_id, file, date)

    After watching a fantastic video here on Migx :https://www.youtube.com/watch?v=Dv83iC9iELI I was able to create a custom manager page that lists all the downloads.

    My issue is though that my "user_id" column from that table contains the modx user id of course - and I need it to show the ModX fullname.

    I played around with the "joins" field under the MIGXdb-Settings tab... I assume I need to join on the modx_user_attributes table to get the fullname, but I cannot for the life of me figure out how to get this to work.

    So I went in another direction using the renderchunk method for the user_id column of my downloads datagrid. While I got this to work using a snippet to get the username from the user id number from the column, it unfortunately does not export when I "Export Current View". It exports the user_id number from the dataset of course. I expect I can't add a filter to this column yet for names either, but I haven't gotten there yet.

    Any help?
      • 4172
      • 5,888 Posts
      are you talking now about the frontend (migxLoopCollection) or about the grid in the backend?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40041
        • 36 Posts
        Hi Bruno,

        I'm referring to the back end grid on a custom manager page.

        Thanks!
          • 40041
          • 36 Posts
          Quote from: Bruno17 at Aug 05, 2015, 06:03 PM
          are you talking now about the frontend (migxLoopCollection) or about the grid in the backend?

          Quote from: robcarey at Aug 05, 2015, 06:14 PM
          I'm referring to the back end grid on a custom manager page.

          Was that the wrong answer? smiley
            • 4172
            • 5,888 Posts
            Would you like to post your MIGX-configuration and your xpdo-schema.
            With this information, I can recreate your setup in minutes and may see what goes wrong.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 40041
              • 36 Posts
              Ok. Ignore the value in the "joins" area - just trying to figure it out.

              <?xml version="1.0" encoding="UTF-8"?>
              <model package="salestools" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
              	<object class="Downloads" table="downloads" extends="xPDOSimpleObject">
              		<field key="user_id" dbtype="int" precision="11" phptype="integer" null="false" />
              		<field key="file" dbtype="varchar" precision="255" phptype="string" null="false" />
              		<field key="dl_date" dbtype="timestamp" phptype="timestamp" null="false" default="CURRENT_TIMESTAMP" />
              	</object>
              	<object class="Subscriptions" table="subscriptions" extends="xPDOSimpleObject">
              		<field key="resource_id" dbtype="int" precision="11" phptype="integer" null="false" />
              		<field key="user_id" dbtype="int" precision="11" phptype="integer" null="false" />
              	</object>
              </model>
              


              {
                "id":1,
                "name":"Downloads",
                "formtabs":"",
                "contextmenus":"",
                "actionbuttons":"exportview",
                "columnbuttons":"",
                "filters":"",
                "extended":{
                  "migx_add":"",
                  "disable_add_item":"",
                  "add_items_directly":"",
                  "formcaption":"",
                  "update_win_title":"",
                  "win_id":"download",
                  "maxRecords":"",
                  "addNewItemAt":"bottom",
                  "multiple_formtabs":"",
                  "multiple_formtabs_label":"",
                  "multiple_formtabs_field":"",
                  "multiple_formtabs_optionstext":"",
                  "multiple_formtabs_optionsvalue":"",
                  "actionbuttonsperrow":4,
                  "winbuttonslist":"",
                  "extrahandlers":"",
                  "filtersperrow":4,
                  "packageName":"salestools",
                  "classname":"Downloads",
                  "task":"",
                  "getlistsort":"",
                  "getlistsortdir":"",
                  "sortconfig":"",
                  "gridpagesize":"",
                  "use_custom_prefix":1,
                  "prefix":"sv_",
                  "grid":"",
                  "gridload_mode":1,
                  "check_resid":1,
                  "check_resid_TV":"",
                  "join_alias":"",
                  "has_jointable":"yes",
                  "getlistwhere":"",
                  "joins":"modx_user_attributes.internalKey = sv_downloads.user_id",
                  "hooksnippets":"",
                  "cmpmaincaption":"Downloads",
                  "cmptabcaption":"All Downloads",
                  "cmptabdescription":"Downloads List",
                  "cmptabcontroller":"",
                  "winbuttons":"",
                  "onsubmitsuccess":"",
                  "submitparams":""
                },
                "columns":[
                  {
                    "MIGX_id":1,
                    "header":"ID",
                    "dataIndex":"id",
                    "width":6,
                    "sortable":"false",
                    "show_in_grid":1,
                    "renderer":"",
                    "clickaction":"",
                    "selectorconfig":"",
                    "renderchunktpl":"",
                    "renderoptions":"",
                    "editor":""
                  },
                  {
                    "MIGX_id":2,
                    "header":"User ID",
                    "dataIndex":"user_id",
                    "width":6,
                    "sortable":true,
                    "show_in_grid":1,
                    "renderer":"",
                    "clickaction":"",
                    "selectorconfig":"",
                    "renderchunktpl":"",
                    "renderoptions":"",
                    "editor":""
                  },
                  {
                    "MIGX_id":3,
                    "header":"File",
                    "dataIndex":"file",
                    "width":"",
                    "sortable":true,
                    "show_in_grid":1,
                    "renderer":"",
                    "clickaction":"",
                    "selectorconfig":"",
                    "renderchunktpl":"",
                    "renderoptions":"",
                    "editor":""
                  },
                  {
                    "MIGX_id":4,
                    "header":"Download Date",
                    "dataIndex":"dl_date",
                    "width":15,
                    "sortable":true,
                    "show_in_grid":1,
                    "renderer":"this.renderDate",
                    "clickaction":"",
                    "selectorconfig":"",
                    "renderchunktpl":"",
                    "renderoptions":"",
                    "editor":""
                  }
                ],
                "createdby":1,
                "createdon":"2015-07-31 11:51:07",
                "editedby":1,
                "editedon":"2015-08-05 11:46:28",
                "deleted":0,
                "deletedon":"-1-11-30 00:00:00",
                "deletedby":0,
                "published":1,
                "publishedon":"-1-11-30 00:00:00",
                "publishedby":0
              }