We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42153 ☆ A M B ☆
    • 27 Posts
    Hi,

    Since i'm fairly new to MIGX this might be a no-brainer for any of you but it's impossible for me to fix it.
    The value i've chosen from my MIGX dropdown field is not showing after editing/saving in my Template Variable tab of the resource. I assume it has something to do with my Grid Columns but i can't seem to figure it out.
    I'm talking about my second field "kind". It's a dropdown TV with some static values.

    These are my form tabs:
    [{"caption":"Kunstwerk", "fields": [
        {"field":"name","caption":"Naam"},
        {"field":"kind","caption":"Soort","inputTV":"tplSoort"}, 
        {"field":"size","caption":"Afmeting"}, 
        {"field":"image","caption":"Afbeelding","inputTVtype":"image"}
      ]
    }]


    And these are my grid columns:

    [{
      "header": "Naam", "sortable": "true", "dataIndex": "name"
    },
    "header": "Soort", "sortable": "true", "dataIndex": "kind"
    },
    {
      "header": "Afmeting", "sortable": "true", "dataIndex": "size"
    },
    {
      "header": "Image", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"
    }]


    Any help will be much appreciated!
      • 3109 ☆ A M B ☆
      • 894 Posts
      Well theres a missing { on the grid columns before the Soort header I think that might be the culprit.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 42153 ☆ A M B ☆
        • 27 Posts
        Talking about a no-brainer... thanks! Works like a charm....

        I've got another question though, maybe you can help me out with that too.

        I added a dateTV to be able to do some sorting in the front-end. It gives the createdon date. I don't want it to show in my MIGX grid. Is there a way to hide it in both the formtabs and the grid? Something like inputType = "hidden" or so?

        Thanks in advance!
          • 3109 ☆ A M B ☆
          • 894 Posts
          Hmm not that I know of you should probably request that as a feature I'm not sure if it can be done.
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The createdon date of what? The TV? The resource the TV is attached to?
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 3109 ☆ A M B ☆
              • 894 Posts
              @sotwell I think he's referring to the created date of the MIGX entry (I could be wrong)
                Benjamin Marte
                Interactive Media Developer
                Follow Me on Twitter | Visit my site | Learn MODX
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                I thought so too, but it never hurts to make sure.

                You simply don't put the field in the grid if you don't want to display something in the grid. Having an automatic createdate for items would be an interesting exercise, though.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 3109 ☆ A M B ☆
                  • 894 Posts
                  @sotwell it would not display in the grid but it will display in the form, after reading the MIGX documentation I think you can sort by age, unless that's an example where you must create an age field.

                  It's worth a try to see if it works, good luck.
                    Benjamin Marte
                    Interactive Media Developer
                    Follow Me on Twitter | Visit my site | Learn MODX
                    • 42153 ☆ A M B ☆
                    • 27 Posts
                    Thanks for your replies.

                    Your both right, i need a createdon date for my MIGX entry but i don't want it to show in both my Form tabs and Grid.
                    I already created a simple dateTV but don't know how to get it into the MIGX call.

                    Isn't there a parameter MIGX itself uses to do the sorting which i can call? You're able to drag-and-drop your entries to make some sort of hierarchy so my guess is there is a parameter. But how do i use it in the front-end?

                    @benmarte the 'sort' property only applies to fields you've added yourself.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      The fieldname of the date TV as far as MIGx is concerned is still the field name you use in the formtabs. So if you have a field named "createdate" that is an embedded date/time TV you have created named "createdateTV", it would be addressed by the snippet as "createdate", just like any other field in the formtab.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org