3 Replies Latest reply on May 22, 2013 11:09 PM by Gaurav Jasiwal

    Adding item to custom multifield

    mrray

      I've created a custom multifield (by registering a new xtype in the clientlibs folder) and everything appears great when I first open the edit dialog. However, when I click the 'Add Item +' link, the new set of fields appears correctly, BUT the container is getting set to fill the entire width of the dialog. As a result, the up/down ordering buttons get pushed out of view. The first item's width is fine, but each subsequent item that's added ignores the width and fills the entire dialog.

       

      Has anyone come across a similar issue? How else can I control the width of the custom multifield? I know creating custom multifields can get tricky, but I've kept it relatively simple (a textfield, radio, and richtext). I'm sure more information is need, if so, I'll be more than happy to provide.

       

      Any help is greatly appreciated. Thanks!

        • 1. Re: Adding item to custom multifield
          rush_pawan Level 4

          Hello,

           

          I have tried to overcome from this issue through widget customization but unfortunately i was not able to achieve it completely, but i can share what you can do to get some relax.

           

          1. As you have added 2 extra fields it means now you will have "6" fields in one item set, to adjust it so that all will come in one row everytime you have to set this total count value "6" in widget.

                    - If you are using cq5.5 then in multifield widget js file search for "config = CQ.Util.applyDefaults" (inside CQ.form.MultiField.Item) under this configuration you will find a property "columns" set this value to "6"

                    - If you are using cq5.4 then same you have to by searching defualt config property inside (CQ.form.MultiField.Item)

           

          2. Now to adjust the window size so that your fields doesn't move out of view, you have to set the width of panel (instead auto) which contains this multifield and also set the width of your multifield (instead auto)

               - To do that just set two properties accordingly "boxMinWidth" and "boxMaxWidth" (in pixel)

           

          For more information about config property you can refer http://dev.day.com/docs/en/cq/current/widgets-api/index.html.

           

          I hope above helps you to proceed. for more information let me know.

           

          Thanks,

          Pawan

          1 person found this helpful
          • 2. Re: Adding item to custom multifield
            mrray Level 1

            I was able to solve this issue by adding the 'width' property directly to the fieldConfig node. I was trying to add it on the containing dialog and multifield nodes. Thanks for pointing me in the right direction.

            • 3. Re: Adding item to custom multifield
              Gaurav Jasiwal

              I tried adding width property in "fieldConfig" node, but for me its not working.

              Still i am not able to get fixed size field in custom multfield, its size keep on increasing.