This article introduces to you the solution to the failure of the pop-up box under BootStrap to load the select2 framework through simple code. Friends in need can refer to it
The solution to the failure of the pop-up box to load the select2 framework under bootstrap is as follows Shown:
$("#modal").on("shown.bs.modal", function(){ //等待弹出框弹出后再渲染select2控件 $("#select2").select2({ //再次渲染父界面后才能够加载出来数据。 dropdownParent:$("#mpu_chart"), placeholder: '请选择变量', data:mpuKeys }); });
The above is the detailed content of Perfect solution to the failure of pop-up box loading select2 framework under BootStrap. For more information, please follow other related articles on the PHP Chinese website!