Me gustaria que funcionara este codigo, pero no se donde meter todas las opciones y javascripts...:
Código:
<a href='#' id='select-all'>select all</a> <a href='#' id='deselect-all'>deselect all</a> <a href='#' id='select-100'>select 100 elems</a> <a href='#' id='deselect-100'>deselect 100 elems</a> <select id='public-methods' multiple='multiple'> <option value='elem_1'>elem 1</option> <option value='elem_2' disabled>elem 2</option> <option value='elem_3'>elem 3</option> <option value='elem_4'>elem 4</option> ... <option value='elem_1000'>elem 100</option> </select> $('#public-methods').multiSelect(); $('#select-all').click(function(){ $('#public-methods').multiSelect('select_all'); return false; }); $('#deselect-all').click(function(){ $('#public-methods').multiSelect('deselect_all'); return false; }); $('#select-100').click(function(){ $('#public-methods').multiSelect('select', ['elem_0', 'elem_1' ..., 'elem_99']); return false; }); $('#deselect-100').click(function(){ $('#public-methods').multiSelect('deselect', ['elem_0', 'elem_1' ..., 'elem_99']); return false; }); $('#refresh').on('click', function(){ $('#public-methods').multiSelect('refresh'); return false; }); $('#add-option').on('click', function(){ $('#public-methods').multiSelect('addOption', { value: 42, text: 'test 42', index: 0 }); return false; });