MIGXdb presented in manager page of a resource

Hi all,

i have a MIGXdb that i am wanting to use for creating specific functionality. I want to be able to create and label a button with a certain value that is linked to the resource.

Set up the table (i.e. containing resource, value, and label) as part of a package (Organisatie) i created for other functionality. It has a classname (StemOpties).
Set up a MIGX-config “StemKnoppen” which has the references to package Organisatie and the classname StemOpties.
Created a topmenu item to migx - StemKnoppen, which shows me te correct CMP and some database rows i already filled.

Using the MigxLoopCollection snippet i am able to extract the values for selected resources in the front end.

Also set up a TV StemOpties which has Migxdb as input type and StemKnoppen as the config. It is also set to have correct template access.

However if i go to a selected resource in the backend an view the TV-tab i get an empty table.
like below:

i guess i should be seeing the complete tabel there. Can anyone shed light on this?

the goal is to get only the assigned rows by resource. Tried the getlist where {“resource”:“[[+id]]”} but that didn’t change anything.
As i am not able to find desent documentation to create such an option. i am asking here for your help.

It should work if the column that links to the resource is called “resource_id”.
Also make sure that in the config in the tab “MIGXdb-Settings”, “Check Resource” is set to yes.

If the column is named differently, then maybe the field “Join Alias” works (if the relationship in the schema exists) or you might have to create a custom getlist processor.

Thanx for the fast response,

I changed the column resource to resource_id and altered db and re created all class files.

But still no rows… :frowning:

any other ideas? Some-one who has a situation as this working and willing to share some screenshots / files / set-up.

Can you share your schema and the MIGX-config “StemKnoppen” (right click → “Export/Import” → copy the content of the “Json” field)?

Hi halftrainedharry,
thanx for thinking with me on this problem.

Here’s my config:

{
  "formtabs":[
    {
      "MIGX_id":10,
      "caption":"Knop",
      "print_before_tabs":"0",
      "fields":[
        {
          "MIGX_id":49,
          "field":"resource_id",
          "caption":"resource_id",
          "description":"",
          "description_is_code":"0",
          "inputTV":"",
          "inputTVtype":"",
          "validation":"",
          "configs":"",
          "restrictive_condition":"",
          "display":"",
          "sourceFrom":"config",
          "sources":"",
          "inputOptionValues":"",
          "default":"",
          "useDefaultIfEmpty":"0",
          "pos":1
        },
        {
          "MIGX_id":50,
          "field":"waarde",
          "caption":"waarde",
          "pos":2
        },
        {
          "MIGX_id":51,
          "field":"knop",
          "caption":"knop",
          "pos":3
        },
        {
          "MIGX_id":52,
          "field":"verklaar",
          "caption":"verklaar",
          "pos":4
        }
      ],
      "pos":1
    }
  ],
  "contextmenus":"update||remove",
  "actionbuttons":"addItem",
  "columnbuttons":"update||remove",
  "filters":[
    {
      "MIGX_id":1,
      "name":"pagina",
      "label":"Pagina",
      "emptytext":"Pagina",
      "type":"textbox",
      "getlistwhere":{
        "resource_id":"[[+pagina]]"
      },
      "getcomboprocessor":"",
      "combotextfield":"",
      "comboidfield":"",
      "combowhere":"",
      "comboclassname":"",
      "combopackagename":"",
      "combo_use_custom_prefix":"0",
      "comboprefix":"",
      "combojoins":"",
      "comboparent":"",
      "default":""
    }
  ],
  "extended":{
    "migx_add":"Knop toevoegen",
    "disable_add_item":"",
    "add_items_directly":"",
    "formcaption":"Knop opties",
    "update_win_title":"Knop opties",
    "win_id":"",
    "maxRecords":"",
    "addNewItemAt":"bottom",
    "media_source_id":"",
    "multiple_formtabs":"",
    "multiple_formtabs_label":"",
    "multiple_formtabs_field":"",
    "multiple_formtabs_optionstext":"",
    "multiple_formtabs_optionsvalue":"",
    "actionbuttonsperrow":4,
    "winbuttonslist":"",
    "extrahandlers":"",
    "filtersperrow":1,
    "packageName":"Organisatie",
    "classname":"StemOpties",
    "task":"",
    "getlistsort":"waarde",
    "getlistsortdir":"ASC",
    "sortconfig":"",
    "gridpagesize":"",
    "use_custom_prefix":"0",
    "prefix":"",
    "grid":"",
    "gridload_mode":1,
    "check_resid":1,
    "check_resid_TV":"",
    "join_alias":"",
    "has_jointable":"no",
    "getlistwhere":{
      "resource_id":"[[*id]]"
    },
    "joins":"",
    "hooksnippets":"",
    "cmpmaincaption":"Stemknoppen",
    "cmptabcaption":"Stemknoppen",
    "cmptabdescription":"De knoppen voor het stemmen; 0 = Neutraal",
    "cmptabcontroller":"",
    "winbuttons":"",
    "onsubmitsuccess":"",
    "submitparams":""
  },
  "permissions":{
    "apiaccess":"",
    "view":"",
    "list":"",
    "save":"",
    "create":"",
    "remove":"",
    "delete":"",
    "publish":"",
    "unpublish":"",
    "viewdeleted":"",
    "viewunpublished":""
  },
  "fieldpermissions":"",
  "columns":[
    {
      "MIGX_id":1,
      "header":"ID",
      "dataIndex":"id",
      "width":"",
      "sortable":"false",
      "show_in_grid":"0",
      "customrenderer":"",
      "renderer":"",
      "clickaction":"",
      "selectorconfig":"",
      "renderchunktpl":"",
      "renderoptions":"",
      "editor":""
    },
    {
      "MIGX_id":6,
      "header":"resource_id",
      "dataIndex":"resource_id",
      "width":25,
      "sortable":true,
      "show_in_grid":1,
      "customrenderer":"",
      "renderer":"",
      "clickaction":"",
      "selectorconfig":"",
      "renderchunktpl":"",
      "renderoptions":"",
      "editor":""
    },
    {
      "MIGX_id":8,
      "dataIndex":"waarde",
      "header":"waarde"
    },
    {
      "MIGX_id":5,
      "dataIndex":"knop",
      "header":"knop"
    },
    {
      "MIGX_id":7,
      "dataIndex":"verklaar",
      "header":"verklaar"
    }
  ],
  "category":""
}

The strange thing is that everything functions as it should in snippets, CMP etc. etc. The only thing i can not get working is showing the table with only associated resource on the (current) resource via a TV…

When I remove the “Where” setting {"resource_id":"[[*id]]"} (tab “MIGXdb-Settings”) and the “resource_id” field (tab “Formtabs”), it seems to work.


You can also set “Load Grid” (tab “MIGXdb-Settings”) to auto, so you don’t have to click the “Load Grid” button every time.

Yes Thanx! Thats working!
Seems that no modx-tags are being parsed here.

MODX tags gets parsed here. But the tag [[*id]] is not set in that situation

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.