From 8bebf49fbfb92f039f56cb22b759d8e84ef19799 Mon Sep 17 00:00:00 2001 From: tof <> Date: Thu, 18 Oct 2007 09:22:46 +0000 Subject: Fixed #722 - Add Read only capabilities to TInPlaceTextBox --- .../source/prado/activecontrols/inlineeditor.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'framework/Web/Javascripts') diff --git a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js index f8b8b412..8f480d3d 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js @@ -6,6 +6,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( this.isSaving = false; this.isEditing = false; this.editField = null; + this.readOnly = options.ReadOnly; this.options = Object.extend( { @@ -36,7 +37,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( */ enterEditMode : function(evt) { - if (this.isSaving || this.isEditing) return; + if (this.isSaving || this.isEditing || this.readOnly) return; this.isEditing = true; this.onEnterEditMode(); this.createEditorInput(); @@ -281,5 +282,14 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( textbox.exitEditMode(null); } } - } + }, + + setReadOnly : function(id, value) + { + var textbox = Prado.WebUI.TInPlaceTextBox.textboxes[id]; + if (textbox) + { + textbox.readOnly=value; + } + }, }); \ No newline at end of file -- cgit v1.2.3