Custom Fields
Support General Select2 Library

  • Creator
  • #15222


    I use select_advanced option to show custom posts, my question is:
    Is there a some way to integrate "Select2 Drag and Drop Sorting" as described here:

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
  • #17969
    Austin Passy

    I don't think it's possible since multiple selections get saved into the db a non unique value that isn't indexed. The only real option is a group of selections which you may run into other issues.

    Austin Passy

    In an ideal would it should be simple to add this to the select advanced field type. If an attribute like sortable => true was set along with multiple => true, then the meta data saved would be non-unique and would solve this issue. Then this simple solution (along with enqueuing jquery-ui-sortable) would allow for these fields to be sortable.

    This would be an awesome feature.

    Anh Tran

    We have switched to select4 and it doesn't support this feature anymore. There is some workaround here and the confirmation from the author.

    Austin Passy

    While that works from the sorting perspective, the fact that the data when set to multiple is saved as unique doesn't work. Quickly playing around with the core meta.php files for how data for field types are set. When I forced a multiple advanced selector to single=true data was in fact saved into an array which would of course allow for sorting. I didn't have additional time to play with the JS to force the new index arrays, but I assume it would be close to the way the clone order reindex works.

    Seems more plausible to create a new custom field type to get this done (if I ever find the time or the business needs really require it over cloned select fields (which could get very messy with 40+ clones)).

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.