[CLOSED] hiding elements

  1. #1

    [CLOSED] hiding elements

    I have a standard form and in it i have some elements.
    I want to hide the entire datefield row (including field label and trigger). I tried
    Ext.get("DateFieldStartDate").hide()
    but the trigger and fieldLabel were still there. how can i hide the entire row?
    Thanks,
    /Z


                        <ext:DateField 
                            ID="DateFieldStartDate" 
                            runat="server" 
                            IndicatorText="*" 
                            IndicatorCls="red-text" 
                            AllowBlank="false"
                            ReadOnly="false" 
                            FieldLabel="Start Date"
                            />
                        <ext:TextField ID="TextFieldStartTime"
                            runat="server"
                            FieldLabel="Start Time"
                            IndicatorText="*" 
                            IndicatorCls="red-text" 
                            MaxLength="10"
                        />
    Last edited by Daniil; Jan 15, 2013 at 4:40 AM. Reason: [CLOSED]
  2. #2
    You have to use 'getCmp' instead 'get'
    Also you can use ClientID directly (please note that ClientID doesn't equal ID if a widget inside INamingContainer, like UserControl or MasterPage)
    DateFieldStartDate.hide();
    Please note that in v2 need to use 'App' namespace by default
    App.DateFieldStartDate.hide();
  3. #3
    Thanks!

    getCmp works fine. just used the wrong call. Last question. If I call .hide() on a DateField that has allowBlank=false, how can I tell form.validate() to ignore the hidden fields. Is there a parameter that I can tell it to not valdiate hidden fields?

    /Z
  4. #4
    Hi @Z,

    There is no such an option to ignore validation for hidden fields. It would be great to have it. We will look into it for Ext.NET v2.

    For Ext.NET v1. What about to combine hiding with disabling? Validation is ignored for disabled fields, i.e. they are treated as valid.
    Last edited by Daniil; Jan 14, 2013 at 5:54 AM.
  5. #5
    Quote Originally Posted by Daniil View Post
    There is no such an option to ignore validation for hidden fields. It would be great to have it. We will look into it for Ext.NET v2.
    Generally, disabling fields looks to be a good solution. We will leave it as it is for now.

Similar Threads

  1. [CLOSED] How to select all elements in a gridvew
    By egvt in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 23, 2013, 2:24 PM
  2. [CLOSED] Using HTML elements
    By mcfromero in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 11, 2013, 11:52 AM
  3. Remove elements from PagingToolbar
    By adipoaca in forum 1.x Help
    Replies: 1
    Last Post: Nov 17, 2011, 8:38 AM
  4. Viewport and inner elements
    By unaltro2 in forum 1.x Help
    Replies: 0
    Last Post: Feb 01, 2011, 8:11 AM
  5. Get id of elements into page.ascx
    By flaviodamaia in forum 1.x Help
    Replies: 3
    Last Post: Jan 23, 2009, 7:26 AM

Posting Permissions