[CLOSED] Problem when showing/hiding controls in javascript

  1. #1

    [CLOSED] Problem when showing/hiding controls in javascript

    Hi,

    I have a ComboBox with a list of items and each one refers to a data type (text, number, and date). When I select an item a different field is shown to the user.

    The problem is that when I execute this action the ComboBox gets behind the other control. It was not happening on Ext.Net.dll version 1.0.3909.21027.
    Now I'm using Ext.Net.dll version 1.0.3960.22203.

    NOTE: I need all controls inside a CompositeField and the Text, Number and Date fields must to be Flex=1.

    Follows the example code.


    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    <script type="text/javascript">
    function cmbField_Change()
    {
        var value = cmbFields.getValue();
        
        textField.setVisible(value == 0);
        numberField.setVisible(value == 1);
        dateField.setVisible(value == 2);
    }
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager runat="server" />
        
        <ext:Panel runat="server" Title="Test">
            <Items>
                <ext:CompositeField runat="server" FieldLabel="Type">
                    <Items>
                        <ext:ComboBox ID="cmbFields" runat="server" SelectedIndex="0" Width="120" >
                            <Items>
                                <ext:ListItem Value="0" Text="Text" />
                                <ext:ListItem Value="1" Text="Number" />
                                <ext:ListItem Value="2" Text="Date" />
                            </Items>
                            <Listeners>
                                <Change Handler="cmbField_Change();" />
                                <Select Handler="cmbField_Change();" />
                            </Listeners>
                        </ext:ComboBox>    
                        
                        <ext:TextField ID="textField" runat="server" Flex="1" />
                        <ext:NumberField ID="numberField" runat="server" Hidden="true" Flex="1" />
                        <ext:DateField ID="dateField" runat="server" Hidden="true" Flex="1" />
                    </Items>
                </ext:CompositeField>
            </Items>
        </ext:Panel>
        
        </form>
    </body>
    </html>
    Last edited by Daniil; Nov 05, 2010 at 8:55 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please call doLayout method for composite field after hide/show inner fields
  3. #3
    We are doing some more investigation regarding this issue. We will adjust so that the call to .doLayout() is not required.

    Please stand by.
    Geoffrey McGill
    Founder
  4. #4
    Hi,

    Fixed. Now doLayout called automatically
  5. #5
    I tried to update from SVN but there was no change in my source files.
    Is there something I need to do?
  6. #6
    Hi,

    What repository do you use?
    Please use http://svn.ext.net/pro/trunk
    Please follow to this post
    http://forums.ext.net/showthread.php...ll=1#post43021

Similar Threads

  1. [CLOSED] Problem hiding/showing controls
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 29, 2012, 3:37 PM
  2. [CLOSED] Hiding/showing Tabpanel buggy
    By mirwais in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 14, 2012, 11:26 AM
  3. [CLOSED] Problem Hiding/Showing TreeGrid Columns in Chrome
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 17, 2011, 2:13 PM
  4. [CLOSED] Problems with layouts after hiding/showing
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jul 29, 2011, 3:53 AM
  5. Hiding and Showing up a TapPanel
    By pearl in forum 1.x Help
    Replies: 0
    Last Post: Mar 11, 2009, 8:27 AM

Tags for this Thread

Posting Permissions