Bootstrap-Select plugin not working with time consuming page load

怎甘沉沦 提交于 2019-12-11 07:59:18

问题


I am using bootstrap select plugin of silviomoreto. I am using it in an ASP.Net MVC application. I am using this with show tick option. The code is like this.

setTimeout(function () {
     $('#ddlSortBy').selectpicker({
                'selectedText': 'Select'                   
                }
            });

        }, 200);

The problem is that this plug is not working without settimeout method in my application. I have to attach this plugin within settimeout method and within document.ready method.

However some time when a page loading takes more that 200 ms what I find that plugin is applied to html select but clicking on item in select is not working. So I have to increase the timeout of to attach then its works. But ideally it should works once attached to a html select element.

来源:https://stackoverflow.com/questions/27580074/bootstrap-select-plugin-not-working-with-time-consuming-page-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!