On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • How would one go about adding a MODX Combo to a Collections package list as an editor?

    So far I have the editor set to: {"xtype":"modx-combo","data":["FR","SO","JR","SR"]} but the data does not show up as options. Is it just not implemented? The TV is a dropdown menu so I'd like to only allow the options contained in the TV to be edited from the list.
    • I Did not understand what you are doing. But I think the data element is just wrong.
      It should be something like that:

              {
                  xtype: 'modx-combo'
                  , store: new Ext.data.SimpleStore({
                      id: 0
                      , fields: [{name: 'id'}, 'name']
                      , data: [
                            ['FR', 'FR']
                          , ['SO', 'SO']
                          , ['JR', 'JR']
                          , ['SR', 'SR']
                      ]
                  })
                  , triggerAction: 'all'
                  , valueField: 'id'
                  , displayField: 'name'
                  , mode: 'local'
              }
      • Hi,
        form me, your code gives an error:
        Uncaught TypeError: undefined is not a function Ext-all.js:21 [ed. note: vhollo last edited this post 4 years, 2 months ago.]
        • Is there any update on this issue? I tried setting data: [["value1"],["value2"]] (and few other combinations as well) with no luck, so I wonder is there any way to add modx-combo with your own values to the list?
          Just to make it clear: I'm trying to add a dropdown-list for my TV in the Collections view.
          [ed. note: vallev last edited this post 3 years, 1 month ago.]
            Kind regards
          • Shawn Himelberger Reply #5, 1 year, 1 month ago
            I've been noodling on this myself as well for a while. Any one else have a xtype string that is confirmed working? I found this tool https://jsoneditoronline.org/ for stripping out all the whitespace and returns. Collections doesn't like those.
              Shawn Himmelberger
              Himmelberger Design
              https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Design | https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Development