Tagged: 

Viewing 9 reply threads
  • Author
    Posts
    • #2512
      kattagami
      Member

      Hi,

      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

    • #2513
      Steve
      Keymaster

      @kattagami– We’ve discussed this internally, and it’s on our feature list, but it’s currently not possible.

    • #2514
      Jason
      Keymaster

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

    • #2515
      kattagami
      Member

      Thanks very much Jason, I’m going to try your js solution 🙂

    • #2526
      kattagami
      Member

      Mhmm … remove the “ui-sortable” class from the <td> doesn’t seem to disable the drag and drop reorder.

    • #2527
      Jason
      Keymaster

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

    • #5106
      kattagami
      Member

      Hello,

      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

    • #5115
      Steve
      Keymaster

      Try 'sortable' => false

    • #5119
      kattagami
      Member

      Works like a charm 🙂
      Awesome !

      Thanks Steve

    • #5121
      Steve
      Keymaster

      Great! Closing ticket.

Viewing 9 reply threads
  • The topic ‘Disable drag and drop reorder on add_more fields’ is closed to new replies.