We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42967
    • 143 Posts
    yes! thank you so much, it is working great now. This is much better for clients.

    The publish/unpublished column buttons do not work is this because they are only for migxdb? The context menus also ignore my selections in the configuration. [ed. note: eighthday last edited this post 13 years, 6 months ago.]
      Eighth day design
      Design agency with offices in Edinburgh and Brighton
      • 4172
      • 5,888 Posts
      publish/unpublish and some others are designed for MIGXdb, but there is another option:

      you can create a new column for published and use the renderSwitchStatusOptions - renderer for this column.
      you should have a formtabs-field 'published' with a default-value 1 or 0

      this is part of my configuration, which shows the cofniguration for the published-field with the renderer and the renderOptions for status published/unpublished:
      {"MIGX_id":"4","header":"Published","dataIndex":"published","width":"","sortable":"false","show_in_grid":"1","renderer":"this.renderSwitchStatusOptions","clickaction":"switchOption","selectorconfig":"","renderoptions":"[{\"MIGX_id\":\"1\",\"name\":\"unpublish\",\"value\":\"1\",\"clickaction\":\"\",\"handler\":\"\",\"image\":\"assets\\\/components\\\/migx\\\/style\\\/images\\\/tick.png\"},{\"MIGX_id\":\"2\",\"name\":\"publish\",\"value\":\"0\",\"clickaction\":\"\",\"handler\":\"\",\"image\":\"assets\\\/components\\\/migx\\\/style\\\/images\\\/cross.png\"}
      


      don't forget to check the this.handleColumnSwitch - handler under the 'Handlers' - tab!
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40045
        • 534 Posts
        Great addition Bruno, thanks again!

        Just tried it out and it works almost perfectly! (Working with your 4h old 2.4.2beta2)

        If I add the update/remove_migx buttons the descriptions show up correctly (without doing anything custom like you showed in grid.config.inc) but if I also want a "duplicate" button, I got the same "no-text-in-button" issue as eightday, but only for this one, the other two buttons are fine^^=)...see attached screenshots.





        Also tried the publish/unpublish functionality, love it!



        Is it right that you HAVE to specify the renderoptions? Clicking on the cross/tick started to work when I specified them (decrypting the config you provided in the instructions above) like you did. But I also got this error notice on top of the whole manager:

        Notice: Undefined index: selectorconfig in /var/www/modx/core/components/migx/model/migx/migx.class.php on line 897 Notice: Undefined index: selectorconfig in /var/www/modx/core/components/migx/model/migx/migx.class.php on line 897 Notice: Undefined index: published in /var/www/modx/core/components/migx/model/migx/migx.class.php on line 926 Notice: Undefined index: published in /var/www/modx/core/components/migx/model/migx/migx.class.php on line 926 Notice: Undefined index: published in /var/www/modx/core/components/migx/model/migx/migx.class.php on line 926

        Another thing I noticed is that when I have to choose the image for the renderoption, I cannot (as usually) select the correct media source in the file manager/browser...so I couldn't select the image because my default MS is pointing to a directory inside assets/site/ and the migx images are in assets/componentes...I have another MS "System" which has access from the webroot, that would work if I could select it =)...I just added the paths manually, but the images didn't render in the renderoptions grid but they did render (as can be seen in the screenshot above) in the actual migx grid, so just a little remark there...

        And there also raised the question of how I would make getImageList respect that publish/unpublish stuff: I guess with a simple &where=`{"published:=":"1"}` param?

        really great work again and again... [ed. note: exside last edited this post 13 years, 6 months ago.]
          • 42967
          • 143 Posts
          exside, you will need to update core / components / migx / configs / grid / grid.config.inc.php

          $gridcontextmenus['duplicate']['code']="
                  m.push({
                      className : 'duplicate', 
                      text: '[[%migx.duplicate]]',
                      handler: 'this.duplicate'
                  });
                  m.push('-');
          ";
            Eighth day design
            Design agency with offices in Edinburgh and Brighton
            • 42967
            • 143 Posts
            I don't get an image at all, here is the generated html for the published button:

            <a href="#">
            <img class="controlBtn undefined this.handleColumnSwitch published" title="" alt="" src="/undefined">
            </a>
              Eighth day design
              Design agency with offices in Edinburgh and Brighton
              • 4172
              • 5,888 Posts
              your values for published are 1 or 0 and you have selected the images (cross and tic) in the renderoptions?

              may be it doesn't show the images on new created records, but should on existing ones.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 42967
                • 143 Posts
                yes

                  Eighth day design
                  Design agency with offices in Edinburgh and Brighton
                  • 40045
                  • 534 Posts
                  Quote from: Bruno17 at Apr 04, 2013, 05:11 AM
                  your values for published are 1 or 0 and you have selected the images (cross and tic) in the renderoptions?

                  may be it doesn't show the images on new created records, but should on existing ones.



                  actually have the same problem with the images not showing up (+ the media source issue in the MIGX configuration itself, also there the images don't show up), I posted earlier that t works but it only does if after initial load I click once on the missing-image-icon, then it appears, initially it shows the same /undefined image code as eightday posted...
                    • 4172
                    • 5,888 Posts
                    (+ the media source issue in the MIGX configuration itself

                    this isn't an issue with MIGX but an issue with your mediasource-configurations.
                    to select an image from there, your will need to have access to a mediasource which points to the root, of course.
                    This is normally the default filesystem-mediasource.
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 40045
                      • 534 Posts
                      I have one (not the default one, which seems to be the problem), but I cannot choose it as I can normally in the filemanager MS-Dropdown...there is none =)

                      Any idea about why that notice messages are showing up? Checked migx.class.php at the related lines, but couldn't find anything bad looking^^...for me it would be fine if I could just stop these from showing up at the top of the manager =D...

                      [ed. note: exside last edited this post 13 years, 6 months ago.]