We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17412
    • 270 Posts
    Hi,
    I've implemented exactly the set up described here: https://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.sortable-resourcelist

    Works great! though one aesthetic issue is that the default state (prior to setting active/inactive) is that a broken image shows for each row:



    As soon as a row is clicked then the cross.png shows, clicking again shows the tick.png.

    I'm using the default media source


    Any ideas what could be the issue?

    I'm running MODx REVO 2.3.5-pl | MIGX 2.9.4-pl | PHP: 5.4.30 (CGI/FastCGI) | mysql: 5.1.73

    Thanks. [ed. note: lokust last edited this post 11 years, 3 months ago.]
      • 4172
      • 5,888 Posts
      can't edit this rtfm - page for some reason.

      Try this setup:

      {
        "formtabs":[
          {
            "MIGX_id":123,
            "caption":"main",
            "print_before_tabs":"0",
            "fields":[
              {
                "MIGX_id":482,
                "field":"active",
                "caption":"Active",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"listbox",
                "configs":"",
                "sourceFrom":"config",
                "sources":"[]",
                "inputOptionValues":"yes==1||no==0",
                "default":"0",
                "pos":1
              },
              {
                "MIGX_id":483,
                "field":"comment",
                "caption":"Comment",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"textarea",
                "configs":"",
                "sourceFrom":"config",
                "sources":"[]",
                "inputOptionValues":"",
                "default":"",
                "pos":2
              },
              {
                "MIGX_id":484,
                "field":"pagetitle",
                "caption":"",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"hidden",
                "configs":"",
                "sourceFrom":"config",
                "sources":"[]",
                "inputOptionValues":"",
                "default":"",
                "pos":3
              },
              {
                "MIGX_id":485,
                "field":"id",
                "caption":"",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"hidden",
                "configs":"",
                "sourceFrom":"config",
                "sources":"[]",
                "inputOptionValues":"",
                "default":"",
                "pos":4
              }
            ],
            "pos":1
          }
        ],
        "contextmenus":"",
        "actionbuttons":"",
        "columnbuttons":"",
        "filters":"",
        "extended":{
          "migx_add":"",
          "disable_add_item":1,
          "add_items_directly":"",
          "formcaption":"",
          "update_win_title":"",
          "win_id":"migx_input_options",
          "maxRecords":"",
          "addNewItemAt":"bottom",
          "multiple_formtabs":"",
          "multiple_formtabs_label":"",
          "multiple_formtabs_field":"",
          "multiple_formtabs_optionstext":"",
          "multiple_formtabs_optionsvalue":"",
          "actionbuttonsperrow":1,
          "winbuttonslist":"",
          "extrahandlers":"this.handleColumnSwitch",
          "filtersperrow":1,
          "packageName":"",
          "classname":"",
          "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":"",
          "cmptabcaption":"",
          "cmptabdescription":"",
          "cmptabcontroller":"",
          "winbuttons":"",
          "onsubmitsuccess":"",
          "submitparams":""
        },
        "columns":[
          {
            "MIGX_id":1,
            "header":"Pagetitle",
            "dataIndex":"pagetitle",
            "width":"",
            "sortable":"false",
            "show_in_grid":1,
            "renderer":"",
            "clickaction":"",
            "selectorconfig":"",
            "renderoptions":"[]"
          },
          {
            "MIGX_id":2,
            "header":"Active",
            "dataIndex":"active",
            "width":"",
            "sortable":"false",
            "show_in_grid":1,
            "renderer":"this.renderSwitchStatusOptions",
            "clickaction":"switchOption",
            "selectorconfig":"",
            "renderchunktpl":"",
            "renderoptions":[
              {
                "MIGX_id":3,
                "name":"unpublished",
                "use_as_fallback":1,
                "value":"0",
                "clickaction":"switchOption",
                "handler":"",
                "image":"assets\/components\/migx\/style\/images\/cross.png"
              },
              {
                "MIGX_id":1,
                "name":"published",
                "use_as_fallback":"",
                "value":1,
                "clickaction":"switchOption",
                "handler":"",
                "image":"assets\/components\/migx\/style\/images\/tick.png"
              },
              {
                "MIGX_id":2,
                "name":"unpublished",
                "use_as_fallback":"",
                "value":"0",
                "clickaction":"switchOption",
                "handler":"",
                "image":"assets\/components\/migx\/style\/images\/cross.png"
              }
            ],
            "editor":""
          },
          {
            "MIGX_id":3,
            "header":"Comment",
            "dataIndex":"comment",
            "width":"",
            "sortable":"false",
            "show_in_grid":1,
            "renderer":"",
            "clickaction":"",
            "selectorconfig":"",
            "renderoptions":"[]"
          },
          {
            "MIGX_id":4,
            "header":"",
            "dataIndex":"x",
            "width":"",
            "sortable":"false",
            "show_in_grid":"0",
            "renderer":"this.renderChunk",
            "clickaction":"",
            "selectorconfig":"",
            "renderoptions":"[]"
          },
          {
            "MIGX_id":5,
            "header":"ID",
            "dataIndex":"id",
            "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!
        • 17412
        • 270 Posts
        That works just perfect - cheers Bruno!!
          • 17412
          • 270 Posts
          I just discovered a new issue with this setup.

          I've selected 6 items to display and unfortunately I cannot save the resource > in MODx error log I can see a massive amount of information provoked by trying to save (8mb each time)
          Error: Got a packet bigger than 'max_allowed_packet' bytes

          Tiny sample of error log:

          [2015-07-30 17:25:00] (ERROR @ /connectors/index.php) Error 08S01 executing statement:
          UPDATE `modx_site_tmplvar_contentvalues` SET `value` = '[{\"id\":\"14\",\"pagetitle\":\"Twitter\",\"MIGX_id\":\"14\",\"active_ro\":\"{\\\"MIGX_id\\\":1,\\\"name\\\":\\\"published\\\",\\\"use_as_fallback\\\":\\\"\\\",\\\"value\\\":1,\\\"clickaction\\\":\\\"switchOption\\\",\\\"handler\\\":\\\"\\\",\\\"image\\\":\\\"assets\\\\/components\\\\/migx\\\\/style\\\\/images\\\\/tick.png\\\",\\\"idx\\\":1,\\\"_renderer\\\":\\\"this.renderSwitchStatusOptions\\\",\\\"selectorconfig\\\":\\\"\\\"}\",\"x_ro\":\"\",\"_this.value\":\"<pre>Array\\n(\\n [id] => 14\\n [pagetitle] => Twitter\\n [MIGX_id] => 14\\n [active_ro] => {\\\"MIGX_id\\\":1,\\\"name\\\":\\\"published\\\",\\\"use_as_fallback\\\":\\\"\\\",\\\"value\\\":1,\\\"clickaction\\\":\\\"switchOption\\\",\\\"handler\\\":\\\"\\\",\\\"image\\\":\\\"assets\\\\/components\\\\/migx\\\\/style\\\\/images\\\\/tick.png\\\",\\\"idx\\\":1,\\\"_renderer\\\":\\\"this.renderSwitchStatusOptions\\\",\\\"selectorconfig\\\":\\\"\\\"}\\n [x_ro] => \\n [_this.value] => <pre>Array\\n(\\n [id] => 14\\n [pagetitle] => Twitter\\n [MIGX_id] => 14\\n [active_ro] => {\\\"MIGX_id\\\":2,\\\"name\\\":\\\"unpublished\\\",\\\"use_as_fallback\\\":\\\"\\\",\\\"value\\\":\\\"0\\\",\\\"clickaction\\\":\\\"switchOption\\\",\\\"handler\\\":\\\"\\\",\\\"image\\\":\\\"assets\\\\/components\\\\/migx\\\\/style\\\\/images\\\\/cross.png\\\",\\\"idx\\\":2,\\\"_renderer\\\":\\\"this.renderSwitchStatusOptions\\\",\\\"selectorconfig\\\":\\\"\\\"}\\n [x_ro] => \\n [_this.value] => <pre>Array\\n(\\n [id] => 14\\n [pagetitle] => Twitter\\n [MIGX_id] => 14\\n [active_ro] => {\\\"MIGX_id\\\":1,\\\"name\\\":\\\"published\\\",\\\"use_as_fallback\\\":\\\"\\\",\\\"value\\\":1,\\\"clickaction\\\":\\\"switchOption\\\",

          I have 9 items in my MIGx list and want to select 6 as active.