Que*_*tin 12 jquery twitter-bootstrap bootstrap-modal bootstrap-select
我正在将1000条记录加载到bootstrap select下拉列表中.在Chrome中需要大约2秒钟,但在IE 9中需要30秒.此外,在IE中取消或x输出引导模式也需要10 + s.API调用没问题,但渲染速度很慢; 有人可以给我一些方向吗?
所以我正在加载客户列表并设置所选.这是代码.
var customerPicker = $('#customer-picker');
API.getCustomers().then(function (result) {
loadDropdown(customerPicker, result.customers);
// set the selected to current customer; it takes 10s in IE
customerPicker.val(currentCustomerId).selectpicker('refresh');
// it takes about 10s in IE too. selector is the bs modal div
$(selector).css('z-index', '1060').modal('show');
}).catch(function (errorMessage) {
ToastManager.showError(errorMessage || 'An error occurred while loading customer list. Please try again.');
});
function loadDropdown($div, arr) {
var options = '';
$.each(arr, function (i, item) {
options = options + '<option value="' + item.Value + '">' + item.Text + '</option>';
});
$div.html(options);
}
Run Code Online (Sandbox Code Playgroud)