We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40016
    • 32 Posts
    Hi all,

    I am trying to make a TV with MIGX in which I can do the following:

    I want to be able to select resources (from a certain parent), and select these from a multiple select box with type-ahead. So then I would be able to select multiple resources at once and they would all be a separate line in the MIGX interface.
    Then after that i would be able to easily sort these.

    Is this possible at all, or am i better off just using the resourcelist TV and leave MIGX for what it is?
    I prefer the MIGX interface for sorting and viewing the resources so that's why i'm asking.

    Any help would be appreciated and if i'm not clear enough just let me know.

    Thanks in advance

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

      • 40045
      • 534 Posts
      have a look at the checkboxSortable custom TV type extra by @rtripault, together with an @EVAL snippet call to fetch the resources, this is what I use for stuff like that =)
        • 40016
        • 32 Posts
        Didnt know that one, could come in handy but...

        Since it are a lot of resources, a multiple select dropdown would more suit my needs.
        This way i would have to display all th resources (arround 50 and growing). And the type-ahead function is also a real musthave since it is much faster than manual search.
          • 4172
          • 5,888 Posts
          It should be possible with a custom-made listbox-multiple TV-type, which can send the selected resources to the migx-grid for sorting them.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 40016
            • 32 Posts
            What i have now is a MIGX tv with a inputTV single-select that gets the resources via an @EVAL.
            Works good, the only thing missing is the pagetitle in the MIGX grid.

            And a nice-to-have would be to make it multi-select. But when I change the input-type to multi it obviously adds all resources to the same MIGX item.

            @Bruno17, i have never made a custom-made TV-type, wouldn't know where to start. So this means it is not possible out of the magic MIGX box?
            • discuss.answer
              • 4172
              • 5,888 Posts
              you mean a multiselect, which does create multiple items, when multiple was selected.

              should be possible with a plugin for onDocFormSave, which would read the items, if there are items with multiple resources, create new items and remove the one with multiples.

              you would need to refresh the page to see the new created items and to sort them.

              showing the pagetitles instead the ids in the grid-columns is possible with a renderChunk - renderer on another(new) grid-column
              for example fastField-tags should work in the renderChunk-tpl
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 40016
                • 32 Posts
                With all of your tips and a little help from another topic I managed to create a MIGX-TV with a sortable resource-list.
                The only thing I'm leaving for now is to make it multi-select. I leave the MIGX import here for someone else who is interested how to achieve this.

                {
                  "formtabs":[
                    {
                      "MIGX_id":1,
                      "caption":"Elearningpagina's",
                      "print_before_tabs":"0",
                      "fields":[
                        {
                          "MIGX_id":2,
                          "field":"elearningpage",
                          "caption":"E-learning pagina",
                          "description":"Welke pagina moet worden toegevoegd",
                          "description_is_code":"0",
                          "inputTV":"",
                          "inputTVtype":"listbox",
                          "validation":"",
                          "configs":"",
                          "restrictive_condition":"",
                          "display":"",
                          "sourceFrom":"config",
                          "sources":"",
                          "inputOptionValues":"@EVAL return $modx->runSnippet('getResources', array('parents'=>'3', 'showUnpublished'=>'1', 'showHidden'=>'1', 'hideContainers'=>'1','tpl'=>'TVlist','tplLast'=>'TVListLast','context'=>'web', 'limit'=>'0', 'sortby'=>'pagetitle','sortdir'=>'ASC'));",
                          "default":"",
                          "pos":1
                        }
                      ],
                      "pos":1
                    }
                  ],
                  "contextmenus":"",
                  "actionbuttons":"",
                  "columnbuttons":"",
                  "filters":"",
                  "extended":{
                    "migx_add":"Voeg pagina's toe",
                    "disable_add_item":"",
                    "formcaption":"E-learnings pagina's",
                    "update_win_title":"E-learnings pagina's",
                    "win_id":"migx_elearning",
                    "maxRecords":"",
                    "addNewItemAt":"bottom",
                    "multiple_formtabs":"",
                    "actionbuttonsperrow":4,
                    "winbuttonslist":"",
                    "extrahandlers":"",
                    "filtersperrow":4,
                    "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":"",
                    "cmpmaincaption":"",
                    "cmptabcaption":"",
                    "cmptabdescription":"",
                    "cmptabcontroller":"",
                    "winbuttons":"",
                    "onsubmitsuccess":"",
                    "submitparams":""
                  },
                  "columns":[
                    {
                      "MIGX_id":3,
                      "header":"E-learning page",
                      "dataIndex":"elearningpage",
                      "width":"",
                      "sortable":"false",
                      "show_in_grid":"0",
                      "renderer":"",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":""
                    },
                    {
                      "MIGX_id":1,
                      "header":"E-learning pagina",
                      "dataIndex":"elearning-pagetitle",
                      "width":"",
                      "sortable":"false",
                      "show_in_grid":1,
                      "renderer":"this.renderChunk",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"[[#[[+elearningpage]].pagetitle]] (id [[+elearningpage]])",
                      "renderoptions":""
                    }
                  ]
                }