Home > Web Front-end > JS Tutorial > Perfect solution to the failure of pop-up box loading select2 framework under BootStrap

Perfect solution to the failure of pop-up box loading select2 framework under BootStrap

巴扎黑
Release: 2017-09-01 10:32:35
Original
1989 people have browsed it

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 
      }); 
 });
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template