jquery multiselect reload

前端 未结 12 2008
轮回少年
轮回少年 2021-02-05 16:35

How can I add or remove options in JQuery UI Multiselect ? I am initializing the multiselect on page load and I need to remove existing values and add new values based on anothe

12条回答
  •  故里飘歌
    2021-02-05 17:27

    I found the solution for this, first destroy the multiselect and reInitialize it, Thanks for @ Brandon Joyce,

    solutions for this is

    $("#multipleselectboxId").append(toAppend);
    $("#multipleselectboxId").remove(toRemove);
    
    $("#multipleselectboxId").multiselect('destroy');
    $("#multipleselectboxId").multiselect();
    

提交回复
热议问题