From 7e0298bf8dc4c4f42ea8de99d4cdc7684cc15618 Mon Sep 17 00:00:00 2001 From: Ahuing <88407500@qq.com> Date: Fri, 17 Nov 2017 15:47:20 +0800 Subject: [PATCH] =?UTF-8?q?emptyStyle=20=3D=20=E2=80=98none=E2=80=99=20?= =?UTF-8?q?=E6=97=B6=20ajax=E8=AF=B7=E6=B1=82=E6=95=B0=E6=8D=AE=E6=97=B6?= =?UTF-8?q?=E5=AD=90=E9=9B=86=E6=B2=A1=E6=9C=89=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?select=E5=8F=8A=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit emptyStyle = ‘none’ 时 ajax请求数据时子集没有数据,select及显示 --- js/jquery.cxselect.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/jquery.cxselect.js b/js/jquery.cxselect.js index 18aaddd..87ac1a3 100644 --- a/js/jquery.cxselect.js +++ b/js/jquery.cxselect.js @@ -333,10 +333,13 @@ }; }; - _select.html(_html).prop('disabled', false).css({ - 'display': '', - 'visibility': '' - }); + _select.html(_html); + if (data.length) { + _select.prop('disabled', false).css({ + 'display': '', + 'visibility': '' + }); + } // 初次加载设置默认值 if (typeof _select.attr('data-value') === 'string') {