How to hide a field with label in FormLayout

  1. #1

    How to hide a field with label in FormLayout

    Hi,

    Within a FormLayout, When trying to hide a field that has a label (by using any of the Hide(), SetVisible() methods) , the label stays visible.

    Can I hide a field (within a FormLayout) with its label?

    Thanks.

  2. #2

    RE: How to hide a field with label in FormLayout

    If anyone is interested: My solution (at least for ComboBox and TextField) is calling the next method (which I wrote) with the field that we want to hide as a parameter:

    public static void HideFormLayoutField(Coolite.Ext.Web.WebControl field)
    {
        if (field is Coolite.Ext.Web.ComboBox)
        {
            field.AddScript("try {{ Ext.get('{0}').dom.parentNode.parentNode.parentNode.style.display='none'; }} catch(e) {{ }}", field.ClientID);
        }
        else if (field is Coolite.Ext.Web.TextField)
        {
            field.AddScript("try {{ Ext.get('{0}').dom.parentNode.parentNode.style.display='none'; }} catch(e) {{ }}", field.ClientID);
        }
    }

Similar Threads

  1. [CLOSED] Remove the spacing between field in a formlayout
    By sadaf in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 23, 2012, 1:37 PM
  2. [CLOSED] label.Hide() does not hide FieldLabel
    By alexp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 12, 2010, 9:05 PM
  3. ext:Label in FormLayout
    By mrozik in forum 1.x Help
    Replies: 8
    Last Post: Jul 27, 2009, 5:50 PM
  4. Combine label alignement in FormLayout
    By sfvaleriano in forum 1.x Help
    Replies: 4
    Last Post: Jun 24, 2009, 12:31 PM
  5. FormLayout with label above of input
    By pkngan in forum 1.x Help
    Replies: 0
    Last Post: Oct 29, 2008, 1:12 PM

Posting Permissions