Skip to content

Comments

added a fullHeader wrapper#170

Open
MdreW wants to merge 1 commit intolou:masterfrom
MdreW:master
Open

added a fullHeader wrapper#170
MdreW wants to merge 1 commit intolou:masterfrom
MdreW:master

Conversation

@MdreW
Copy link

@MdreW MdreW commented Nov 25, 2014

Hi,
I have added an option for add html at start of $container
example:

    $('#multiselect').multiSelect({
      fullHeader: "<div>your magic html!</div>"
    }

example of search in both lists :

$('#multiselect').multiSelect({
  keepOrder: true,
  fullHeader: "<input type='text' id='multiselect_search' class='search-input' autocomplete='off' placeholder='Cerca'>",
  afterInit: function(ms){
    var that = this;
    var $search = $('#multiselect_search');
    selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)',
    selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected';

    that.qs1 = $('#multiselect_search').quicksearch(selectableSearchString)
    .on('keydown', function(e){
      if (e.which === 40){
        that.$selectableUl.focus();
        return false;
      }
    });

    that.qs2 = $('#multiselect_search').quicksearch(selectionSearchString)
    .on('keydown', function(e){
      if (e.which == 40){
        that.$selectionUl.focus();
        return false;
      }
    });

  },
  afterSelect: function(){
    this.qs1.cache();
    this.qs2.cache();
  },
  afterDeselect: function(){
    this.qs1.cache();
    this.qs2.cache();
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant