From 601013472851384f0ed2ab309df86185794c2531 Mon Sep 17 00:00:00 2001 From: lascyb <37490770+lascyb@users.noreply.github.com> Date: Tue, 22 Dec 2020 18:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E4=BD=86=E6=98=AF=E6=97=A0=E6=B3=95=E9=80=89?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 写死的key:0 ,当存在默认值时,修改为可自动获取row --- selectpage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/selectpage.js b/selectpage.js index 053b3df..06b067b 100644 --- a/selectpage.js +++ b/selectpage.js @@ -821,6 +821,11 @@ self.prop.init_set = false; }else{ var row = data[0]; + $.each(data,function (i,rows) { + if(rows[p.keyField]==p.value){ + row=data[i]; + } + }) self.elem.combo_input.val(getText(row)); self.elem.hidden.val(row[p.keyField]); self.prop.prev_value = getText(row); @@ -2257,4 +2262,4 @@ $.fn.selectPage = old; return this; }; -})(window.jQuery); \ No newline at end of file +})(window.jQuery);