We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46950
    • 86 Posts
    For this table I need only two fields, that's why I repeated all the steps I had done for the previous example, only for two fields. The steps are:

    1) Creating TV with the name "prices" and caption "Prices", its Input Type is "migx". Its Form Tabs is:
    [
    {"caption":"Prices","fields": [
    {"field":"description","caption":"Description"},
    {"field":"price","caption":"Price"}
    ]
    }]

    Its Grid Columns is:

    [
    {"header": "Description", "width": "70", "sortable": "false", "dataIndex": description"},
    {"header": "Price", "width": "15", "sortable": "false", "dataIndex": "price"}
    ]

    Looks like now I could be able to add lines to the table? I click the button "Add Item", type some values and see that nothing has been added! sad

    2) The snippet is:
    <table border=1>
    [[getImageList?&tvname=`prices`&tpl=`pricesTpl`]]
    </table>

    3) The chunk pricesTpl is:
    <tr>
    <td>[[+description]]</td>
    [[+price:notempty=`<td>[[+price]]</td>`:default=`<td>Empty</td>`]]
    </tr>

    So, now I see nothing on the screen where the snippet is -- not even the word "Empty" which I suppose should be there sad

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

    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yours didn't work I got an add item button but no grid at all, so here's what works for me. I don't see a difference, but then it's been a busy day and my eyes are tired.

      [
      {"caption":"Prices", "fields": [
          {"field":"description","caption":"Description"},
          {"field":"price","caption":"Price"}
      ]}
      ]


      [
      {"header": "Description", "width": "160", "sortable": "true", "dataIndex": "description"},
      {"header": "Price", "width": "50", "sortable": "true", "dataIndex": "price"}
      ]
        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
        • 46950
        • 86 Posts
        Quote from: sottwell at Aug 11, 2014, 08:50 AM
        Yours didn't work I got an add item button but no grid at all, so here's what works for me. I don't see a difference, but then it's been a busy day and my eyes are tired.
        Thank you very much, maybe you won't believe me but now it works! smiley It seems to me that a part of my troubles was connected with the fact that I hadn't given my TV the permission to be displayed with the corresponding script.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Yeah, that will cause a problem wink
            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