Skip to content

is there other easy way to reserve selected order  #61

@openxyz

Description

@openxyz

not only i want konw which items were seleced,,but also what order these selected items was..

so i do it as below , Is there other easy way ?

$(document).on("submit", "form", function(event){
    var mselect = $('#myselect');
    var ms = $('#ms-myselect');
    var ids = $.map(ms.find('.ms-selection li[ms-value]'),function(e){return $(e).attr('ms-value')})

    mselect.append(mselect.find("option").remove().sort(function(a, b) {
      return ids.indexOf($(a).val()) > ids.indexOf($(b).val());
    }));
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions