Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1845
MVC Helper - Hide textbox
posted

Using the MVC Helper, how do you set the textbox to be hidden?  I've tried using the "Display" property as listed in the documentation linked below, but this property doesn't exist in the MVC Helper.

http://help.infragistics.com/jQuery/2012.1/ui.igtexteditor

  • 23953
    Verified Answer
    Offline posted

    Hi JoshNoe,

    As you already noticed we don't have Display method in the TextEditor MVC Wrapper. I have to check what is the cause of lacking this method in the MVC wrapper.

    For now you can use the following workaround if it fits for you:

     

     

    Code Snippet
    1. <style>
    2.     .hidden {display: none !important;}
    3. </style>
    4. @(Html.Infragistics().TextEditor().HtmlAttributes(new Dictionary<string, object>() { { "class", "hidden" } }).Render())

     

    In the code I use HtmlAttributes method to add new css class to the TextEditor. This class is defined as "!important", because TextEditor already uses "display" rule, thus I need to make my rule with higher priority and override the one that comes in the style attribute of the editor itself.

    Note: First I tried to set style attribute to "display:none", but this doesn't work.

     

    Hope this helps,

    Martin Pavlov

    Infragistics, Inc.