We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29597 ☆ A M B ☆
    • 350 Posts
    Is there a way to display the name of a Formname in MIGX Grid Columns?

    I want to show the type of section selected using Formname in the 'Section type' field of the Grid columns.

    Form tabs
    [{
        "formname":"3 Columns"
        ,"formtabs": [{
            "caption":"Section type"
            ,"fields": [{
                "field":"fake"
                ,"inputTVtype":"hidden"
            }
            ,{
                "field":"title"
                ,"caption":"The title of this section"
            }]
        },{
            "caption":"Column 1"
            ,"fields": [{
                "field":"title"
                ,"caption":"The title of this column"
            },{
                "field":"content"
                ,"caption":"The content of this column"
            }]
        },{
            "caption":"Column 2"
            ,"fields": [{
                "field":"title"
                ,"caption":"The title of this column"
            },{
                "field":"content"
                ,"caption":"The content of this column"
            }]
        },{
            "caption":"Column 3"
            ,"fields": [{
                "field":"title"
                ,"caption":"The title of this column"
            },{
                "field":"content"
                ,"caption":"The content of this column"
            }]
        }]
    },{
        "formname":"2 Columns - image left"
        ,"formtabs": [{
            "caption":"Section type"
            ,"fields": [{
                "field":"fake"
                ,"inputTVtype":"hidden"
            }
            ,{
                "field":"title"
                ,"caption":"The title of this section"
            }]
        },{
            "caption":"Left column"
            ,"fields": [{
                "field":"solo_2_col_img_left_img"
                ,"caption":"Image in left column"
                ,"inputTV":"table_column-visibility-options"
            },{
                "field":"solo_2_col_img_left_img_alt"
                ,"caption":"Image in left column alt text"
                ,"inputTVtype":"image"
            }]
        },{
            "caption":"Right column"
            ,"fields": [{
                "field":"solo_2_col_list_items"
                ,"caption":"List items in the right column"
                ,"inputTV":"solo.list_items"
            }]
        }]
    }]
    


    Grid columns
    [
    {
        "header": "Section title",
        "width": "50%",
        "sortable": "true",
        "dataIndex": "title"
    },
    {
        "header": "Section type",
        "width": "50%",
        "sortable": "true"
        // "dataIndex": "What do I put here to get the name of the formname?"
    }
    ]
    

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

      MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
      DESIGNfromWITHIN, MPThemes and Any Screen Size
      Follow me on Twitter | Read my blog | My code on GitHub
    • discuss.answer
      • 36491
      • 36 Posts
      MIGX_formname?
        • 29597 ☆ A M B ☆
        • 350 Posts
        Thanks frischnetz!
        That works great.

        Grid columns
        [
        {
            "header": "Section title",
            "width": "50%",
            "sortable": "true",
            "dataIndex": "section_title"
        },
        {
            "header": "Section type",
            "width": "50%",
            "sortable": "true",
            "dataIndex": "MIGX_formname"
        }
        ]
        
          MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
          DESIGNfromWITHIN, MPThemes and Any Screen Size
          Follow me on Twitter | Read my blog | My code on GitHub