From 0abe977f45908e8ddd5101f4be5fc754282c09f5 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Thu, 22 Dec 2016 19:16:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=BB=B4=E6=8A=A4=E9=A1=B5=E9=9D=A2=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E5=8F=AF=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Content/js/framework.js | 4 +++- Bootstrap.Admin/Scripts/Users.js | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Bootstrap.Admin/Content/js/framework.js b/Bootstrap.Admin/Content/js/framework.js index a06ab190..9ae09151 100644 --- a/Bootstrap.Admin/Content/js/framework.js +++ b/Bootstrap.Admin/Content/js/framework.js @@ -81,13 +81,15 @@ var op = { dataEntity: $.extend({}, this.options.dataEntity), table: this.options.bootstrapTable, - modal: this.options.modal + modal: this.options.modal, + src: this }; return { 'click .edit': function (e, value, row, index) { op.dataEntity.load(row); $(op.table).bootstrapTable('uncheckAll'); $(op.table).bootstrapTable('check', index); + handlerCallback.call(op.src, null, e, { oper: 'edit' }); $('#' + op.modal).modal("show"); } } diff --git a/Bootstrap.Admin/Scripts/Users.js b/Bootstrap.Admin/Scripts/Users.js index 3e95879e..4c191c3b 100644 --- a/Bootstrap.Admin/Scripts/Users.js +++ b/Bootstrap.Admin/Scripts/Users.js @@ -74,6 +74,12 @@ if (data && data.success && data.oper === 'save' && data.data.ID === $('#userId').val()) { $('#userDisplayName').text(data.data.DisplayName); } + if (data && data.oper === 'create') { + $('#userName').removeProp('readonly').removeClass("ignore"); + } + else if (data && data.oper === 'edit') { + $('#userName').prop('readonly', true).addClass("ignore"); + } } });