0
我將如何處理更新select2下拉列表的值?更新select2值
我已經看過這裏了,我測試過的東西沒有更新,在下拉菜單中更換了數據。 - Update select2 data without rebuilding the control
我將如何處理更新select2下拉列表的值?更新select2值
我已經看過這裏了,我測試過的東西沒有更新,在下拉菜單中更換了數據。 - Update select2 data without rebuilding the control
對於低於標準寫作的道歉,我寫了這個,而我累了。然而我注意到這個話題沒有任何問題/答案,我終於明白了。
我覺得自己有點像一個schlub,因爲沒有及時搞清楚。
$('#element').select2().empty(); // empty the select2
$('#element').select2({ placeholder: 'Select A Model', data: data }); // fill the existing select2 with the data