Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Draggable multiple fields as in Userforms

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 468 Views
  • KINKCreative
    Avatar
    Community Member
    56 Posts

    Draggable multiple fields as in Userforms Link to this post

    Hi guys, I've been in love with the user experience of the UserForms module. There are many occasions where I would need to add a various number of sortable fields and I've either used multiple static fields or DataObjectManager. I guess I'm curious about the next level to learn how to do something like that in the UI.

    A + button which will add a particular field (e.g. Dropdownfield). There is the DRAG option too, which I've seen in some other modules so I am assuming it's actually part of the CMS.

    Would anyone advanced here be able to give a little tutorial and explain the steps needed?

    Thanks a bunch!!

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Draggable multiple fields as in Userforms Link to this post

    I use Widgets for this... or am I missing the point of what you are asking?

  • KINKCreative
    Avatar
    Community Member
    56 Posts

    Re: Draggable multiple fields as in Userforms Link to this post

    Yeah, kinda

    I generally use widgets to manage items in the Sidebar. In this case, I am talking about a $has_many relationship, often ordered. Eg, attaching / featuring a few Dataobjects or pages to a particular page.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Draggable multiple fields as in Userforms Link to this post

    Take a look at UDF (UserForm.js) and see how it works if you're interested!

    Drag and drop is mostly handled by jQuery, the + functionality is an ajax call to a controller which returns the HTML segment with the new form field. In the javascript I then add that HTML to the page.

    468 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.