Tagged: add_more
- This topic has 9 replies, 3 voices, and was last updated 6 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
October 3, 2014 at 5:28 am #2512
kattagamiMemberHi,
Is there a way to disable the drag and drop reorder on an add_more fields?
I need to block the reorder possibility for a particular situation.Thx
-
October 3, 2014 at 9:56 am #2513
SteveKeymaster@kattagami– We’ve discussed this internally, and it’s on our feature list, but it’s currently not possible.
-
October 3, 2014 at 11:07 am #2514
JasonKeymasterUntil it’s supported, you could use javascript to remove the ui-sortable class from the divs of interest. If, for example, your repeatable field has a name of “my-repeated-field”, then this should work:
$('#_my-reapeated-field').find('.ui-sortable').removeClass('.ui-sortable');That’s untested, but something like that should work just fine. Notice the underscore (added by Piklist) to the front of the field name.
Hope this helps! 🙂
-
October 3, 2014 at 11:21 am #2515
kattagamiMemberThanks very much Jason, I’m going to try your js solution 🙂
-
October 6, 2014 at 9:00 am #2526
kattagamiMemberMhmm … remove the “ui-sortable” class from the <td> doesn’t seem to disable the drag and drop reorder.
-
October 6, 2014 at 11:14 am #2527
JasonKeymasterOk, I wondered if that’d do it. Try using the disable method then: http://api.jqueryui.com/sortable/#method-disable
You may need to timeout for 100ms or so to make sure that you disable it after it’s already been enabled. Try first without a timeout, though.
Please let us know if that does the trick!
-
November 27, 2015 at 11:37 am #5106
kattagamiMemberHello,
I comeback with this old request. Is it available in Piklist 0.9.9.x ?
If yes, how can I disable the Drag and Drop from my add_more fields ?Thx
-
November 27, 2015 at 1:30 pm #5115
SteveKeymasterTry
'sortable' => false -
November 27, 2015 at 1:44 pm #5119
kattagamiMemberWorks like a charm 🙂
Awesome !Thanks Steve
-
November 27, 2015 at 1:47 pm #5121
SteveKeymasterGreat! Closing ticket.
-
-
AuthorPosts
- The topic ‘Disable drag and drop reorder on add_more fields’ is closed to new replies.