Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

Draggable multiple fields as in Userforms


Reply

4 Posts   565 Views

Avatar
KINKCreative

7 January 2012 at 3:52am Community Member, 56 Posts

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!!

Avatar
swaiba

7 January 2012 at 5:24am Forum Moderator, 1796 Posts

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

Avatar
KINKCreative

7 January 2012 at 6:25am Community Member, 56 Posts

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.

Avatar
Willr

7 January 2012 at 8:59pm Forum Moderator, 5511 Posts

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.