select2 changing items dynamically

前端 未结 6 1837
执笔经年
执笔经年 2020-12-02 09:23

I have two selects that are linked: Each value of the first select determines which items will be displayed in the second select.

The values of the second select are

6条回答
  •  春和景丽
    2020-12-02 09:28

    I'm successfully using the following to update options dynamically:

    $control.select2('destroy').empty().select2({data: [{id: 1, text: 'new text'}]});

提交回复
热议问题