Show/Hide on TextField with note doesn't affect note
When using an ext tag as per below:
Code:
<ext:TextField runat="server id="MyTextField" Note="My Note">
Actual Behaviour: Using the javascript show()/hide() functions doesn't show/hide the text of the note.
Expected Behaviour: The note should show/hide as appropriate.
Workaround:
Code:
function showHideWithNote(fieldWithNote, show)
{
var note = fieldWithNote.el.dom.parentElement.children[1];
if (show)
{
fieldWithNote.show();
note.style.display = 'block';
}
else
{
fieldWithNote.hide();
note.style.display = 'none';
}
}
RE: Show/Hide on TextField with note doesn't affect note
Hi,
Thanks. Fixed. Also we introduced showNote/hideNote methods.
Small tip for your workaround: there is noteEl field. So, you can use
Code:
fieldWithNote.noteEl.style.display= ....
RE: Show/Hide on TextField with note doesn't affect note
Thanks for the rapid response! :) I hadn't spotted the "noteEl", useful to know!
My only concern with the showNote/hideNote methods would be discoverability as I (and others I know) use the Ext API Docs as a reference manual for Coolite, which obviously won't have the two new methods in them.... Would it perhaps make more sense from a functionality and API cleanliness point-of-view to instead modify the show()/hide() methods so that as well as showing and hiding the parent control, they also acquire responsibility for the note? :=)
RE: Show/Hide on TextField with note doesn't affect note
Hi,
show/hide methods are show/hide note as well. So, you don't need to call both (like show and showNote or hide and hideNote). show/hide method shows/hides field and note