增加load方法的默认值支持

This commit is contained in:
Argo-Lenovo 2017-03-03 13:33:49 +08:00
parent 3375273c59
commit 0efb962554
1 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,9 @@
var ctl = $("#" + this.options.map[name]); var ctl = $("#" + this.options.map[name]);
ctl.val(value[name]); ctl.val(value[name]);
if (ctl.attr('data-toggle') == "dropdown") { if (ctl.attr('data-toggle') == "dropdown") {
ctl.children(':first').text(ctl.next().find('[data-val="' + value[name] + '"]').text()); var val = value[name];
if (!val) val = ctl.attr('data-default-val');
ctl.children(':first').text(ctl.next().find('[data-val="' + val + '"]').text());
} }
} }
}, },