[CLOSED] Hidden="true" behaves as Visible="false"

  1. #1

    [CLOSED] Hidden="true" behaves as Visible="false"

    I'm trying to hide a ComoboBox when it has just one record.

    I need the form layout is mantained; so I expect the control leaves white space at his place.
    But the control disappears freeing space and other controls moves.

    This is "Visible= false" behavioor not "hidden=true"

    My ComboBox is inside a FieldContainer with Layout="HBoxLayout"

    Here is my Combo. Please note in Store Listener.

    M


    <ext:ComboBox ID="cbCilindro" runat="server" Editable="false" ForceSelection="true" ValueField="Code"  DisplayField="Cilindro"  Flex="1"
                            Note="Cilindro" NoteAlign="Top" SelectOnFocus="true" Margins="0 8 0 0" >
                            <ListConfig>
                                <ResizableConfig runat="server" Handles="South" />
                            </ListConfig>
                            <Store>
                <ext:Store ID="stCilindro" runat="server" PageSize="10">
                    <Proxy>
                        <ext:AjaxProxy Json="true" Url="../WebServices/AjaxWebService.asmx/getCilindroProdotto">
                            <ActionMethods Read="POST" />                            
                            <Reader>
                                <ext:JsonReader Root="d.Data" TotalProperty="d.Total" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Parameters>                    
                        <ext:StoreParameter Name="basketID" Value='<%# Request.QueryString["Id"] %>' AutoDataBind="true" />
                        <ext:StoreParameter Name="gruppoMerc" Value="#{cbFamiglieProdotto}.getValue()" Mode="Raw"  />
                        <ext:StoreParameter Name="confezione" Value="#{cbConfezioniProdotto}.getValue()" Mode="Raw" />
                        <ext:StoreParameter Name="campione" Value="false" Mode="Value" />
                    </Parameters>
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="Code" />
                                <ext:ModelField Name="Cilindro" />
                            </Fields>
                        </ext:Model>
                    </Model>
                    <Listeners>
                        <Load Handler="if (records.length==1) { #{cbCilindro}.hide(); }" />
                    </Listeners>
                    <%--<Sorters>
                        <ext:DataSorter Property="Cilindro" Direction="ASC" />
                    </Sorters>--%>
                </ext:Store>            
            </Store>         
                            <Listeners>
                        <Select Handler="#{cbAsse}.clearValue();#{stAsse}.load();" />
                    </Listeners>                
                        </ext:ComboBox>
    Last edited by Daniil; Jun 04, 2012 at 7:39 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I would try with
    HideMode="Visibility"
    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:FormPanel runat="server">
                <Items>
                    <ext:TextField runat="server" FieldLabel="TextField" />
                    <ext:ComboBox 
                        ID="ComboBox1" 
                        runat="server" 
                        FieldLabel="ComboBox" 
                        HideMode="Visibility" />
                    <ext:TextField runat="server" FieldLabel="TextField" />
                </Items>
            </ext:FormPanel>
    
            <ext:Button runat="server" Text="Hide ComboBox">
                <Listeners>
                    <Click Handler="App.ComboBox1.hide();" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #3
    The problem persists.
    I tried every option of the HideMode attribute.

                        <ext:ComboBox ID="cbCilindro" runat="server" Editable="false" ForceSelection="true" ValueField="Code"  DisplayField="Cilindro"  Flex="1" 
                            Note="Cilindro" NoteAlign="Top" SelectOnFocus="true" Margins="0 8 0 0" HideMode="Visibility" >
  4. #4
    But it appears to be working in the example above. So, please provide your full test case.
  5. #5
    To reproduce the errore I just added the Layout="HBoxLayout" attribute.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestExtNet.aspx.cs" Inherits="renosistemi.it.TestExtNet" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:FormPanel runat="server" Layout="HBoxLayout">
            <Items>
                <ext:TextField runat="server" FieldLabel="TextField" />
                <ext:ComboBox ID="ComboBox1" runat="server" FieldLabel="ComboBox" HideMode="Visibility" />
                <ext:TextField runat="server" FieldLabel="TextField" />
            </Items>
        </ext:FormPanel>
        <ext:Button runat="server" Text="Hide ComboBox">
            <Listeners>
                <Click Handler="App.ComboBox1.hide();" />
            </Listeners>
        </ext:Button>
        </form>
    </body>
    </html>
  6. #6
    I can suggest the following solution.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <ext:FormPanel runat="server" Height="25" Layout="HBoxLayout">
            <Items>
                <ext:TextField runat="server" Width="200" FieldLabel="TextField" />
                <ext:Container runat="server" Width="200" Layout="AnchorLayout">
                    <Items>
                        <ext:ComboBox 
                            ID="ComboBox1" 
                            runat="server"
                            FieldLabel="ComboBox" 
                            AnchorHorizontal="100%" />
                    </Items>
                </ext:Container>
                <ext:TextField runat="server" Width="200" FieldLabel="TextField" />
            </Items>
        </ext:FormPanel>
    
        <ext:Button runat="server" Text="Hide ComboBox">
            <Listeners>
                <Click Handler="App.ComboBox1.hide();" />
            </Listeners>
        </ext:Button>
    
        <ext:Button runat="server" Text="Show ComboBox">
            <Listeners>
                <Click Handler="App.ComboBox1.show();" />
            </Listeners>
        </ext:Button>
    </body>
    </html>

Similar Threads

  1. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  2. [CLOSED] DropDownField with Grow="true" and GrowMax="xxx"
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 12, 2012, 12:00 PM
  3. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  4. [CLOSED] Columns Hidden = "True"
    By majunior in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 27, 2011, 2:23 PM
  5. Replies: 0
    Last Post: Jan 18, 2011, 3:53 AM

Posting Permissions