[CLOSED] window is slow

  1. #1

    [CLOSED] window is slow



    Hi
    I have window which opens on button click.
    It takes more then 7 seconds.
    Can you say what i am doing wrong?

    button:
    <ext:Button ID="Button16" runat="server"  Text="Insert" Icon="Add">
    <AjaxEvents><Click OnEvent="CardSelect"></Click></AjaxEvents></ext:Button>
    function to open:
    protected void CardSelect(object sender, AjaxEventArgs e){win_card.Show(); }
    window:
    <ext:Window ID="win_card" runat="server" Icon="User" Closable="true" Title="Contact Methods" Width="350" Height="260" Resizable="false"
     BodyStyle="padding:5px;background-color:#fff;">
    <Body><ext:FormLayout ID="FormLayout2" runat="server">                    
    <ext:Anchor><ext:Panel ID="Panel12" runat="server" Header="false" Border="false">
    <Body><uc3:cards ID="cardes1" runat="server" Title="Card" /></Body>
    </ext:Panel></ext:Anchor>
    </ext:FormLayout></Body>
                
    <Buttons><ext:Button ID="Button8" runat="server" Text="Save" Icon="Disk">
    <AjaxEvents><Click OnEvent="Button8_Click">
    <EventMask ShowMask="true" Msg="Saving..." MinDelay="500" />
    </Click></AjaxEvents></ext:Button>
    </Buttons></ext:Window>
    register file
    <%@ Register src="t/cards.ascx" tagname="cards" tagprefix="uc3" %>
    file
    <%@ Control Language="C#" %>
    
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <script runat="server">
        public string card_type{
            get { return this.cbxCardType.SelectedItem.Value; }
            set { this.cbxCardType.SelectedItem.Value = value; }
        }
    
    
        public string card_description{
            get { return this.Card_Description.Text; }
            set { this.Card_Description.Text = value; }
        }
    
    
        public string card_holder{
            get { return this.Card_Holder.Text; }
            set { this.Card_Holder.Text = value; }
        }
        public string card_company{
            get { return this.CardCompany.SelectedItem.Value; }
            set { this.CardCompany.SelectedItem.Value = value; }
        }
    
    
        public string card_number
        {
            get { return this.Card_Number.Text; }
            set { this.Card_Number.Text = value; }
        }
    
    
        public string card_expiration_date
        {
            get { return this.Expiration_Date.Text; }
            set { this.Expiration_Date.Text = value; }
        }
    
    
        public string card_default
        {
            get { return (this.Card_Default.Checked)?"1":"0"; }
            set { if (value=="1")this.Card_Default.Checked=true;
            else this.Card_Default.Checked = false;
            }
        }
       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
                this.cbxCardType.SelectedItem.Value = "3";
                this.CardCompany.SelectedItem.Value = "";
            }
            
        }
    </script>
    
    
    <ext:FitLayout ID="FitLayout1" runat="server">
        <ext:Panel ID="Panel1" runat="server" FormGroup="true" AutoHeight="true">
            <Body>
                <ext:FormLayout ID="FormLayout1" runat="server">
                    <ext:Anchor Horizontal="100%">
                        <ext:Panel ID="Panel2" runat="server" Border="false" Header="false">
    <Body>                          
    <ext:FormLayout ID="FormLayout2" runat="server">
    <ext:Anchor Horizontal="100%">
    <ext:Panel ID="Panel11" runat="server" BodyBorder="False">
    <Body>
    <ext:TableLayout ID="TableLayout2" runat="server" Columns="3" StyleSpec="border:0px; margin:2px 2px 2px 2px; vertical-align:top;">
    
    
    <ext:Cell><ext:Label ID="Label35" runat="server" Text="Card&amp;nbsp;Type&amp;nbsp;" StyleSpec="margin: 2px 0px 2px 0px; text-align:right;"></ext:Label></ext:Cell>
    <ext:Cell ColSpan="2"><ext:ComboBox ID="cbxCardType" runat="server" StyleSpec="margin: 0px 0px 4px 4px;">
        <Items><ext:ListItem Text="Credit Card" Value="0" />
        <ext:ListItem Text="Frequent Flyer" Value="1" />
        <ext:ListItem Text="Passport" Value="2" />
        <ext:ListItem Text="Other" Value="3" /></Items>
        </ext:ComboBox></ext:Cell>
    
    
    <ext:Cell><ext:Label ID="Label6" runat="server" Text="Card Description&amp;nbsp;" StyleSpec="margin: 2px 0px 2px 0px;"></ext:Label></ext:Cell>
    <ext:Cell ColSpan="2"><ext:TextField ID="Card_Description" runat="server" StyleSpec="margin: 0px 0px 4px 4px;"/></ext:Cell>
    
    
    <ext:Cell><ext:Label ID="Label7" runat="server" Text="Card Holder&amp;nbsp;" StyleSpec="margin: 2px 0px 2px 0px;"></ext:Label></ext:Cell>
    <ext:Cell ColSpan="2"><ext:TextField ID="Card_Holder" runat="server" StyleSpec="margin: 0px 0px 4px 4px;" /></ext:Cell>
    
    
    <ext:Cell><ext:Label ID="Label3" runat="server" Text="Card Number&amp;nbsp;" StyleSpec="margin: 2px 0px 2px 0px;"></ext:Label></ext:Cell>
    <ext:Cell><ext:ComboBox ID="CardCompany" runat="server" StyleSpec="margin: 0px 0px 4px 4px;" Width="55px" BlankText="N/A">
    <Items><ext:ListItem Text="N/A" Value="" />
    <ext:ListItem Text="VI" Value="VI" />
    <ext:ListItem Text="MA" Value="MA" />
    <ext:ListItem Text="AC" Value="AC" />
    <ext:ListItem Text="DC" Value="DC" />
    <ext:ListItem Text="AX" Value="AX" />
    <ext:ListItem Text="TP" Value="TP" /></Items>
    </ext:ComboBox></ext:Cell>
    <ext:Cell><ext:TextField ID="Card_Number" runat="server" StyleSpec="margin: 0px 4px 4px 4px;" /></ext:Cell>
    
    
    <ext:Cell><ext:Label ID="Label1" runat="server" Text="Expiration&amp;nbsp;Date&amp;nbsp;(MM/YYYY)&amp;nbsp;" StyleSpec="margin: 2px 0px 2px 0px;"></ext:Label></ext:Cell>
    <ext:Cell ColSpan="2"><ext:TextField ID="Expiration_Date" runat="server" StyleSpec="margin: 0px 0px 4px 4px;" /></ext:Cell>
    
    
    <ext:Cell><ext:Label ID="Label2" runat="server" Text="Default&amp;nbsp;" StyleSpec="margin: 2px 0px 2px 0px;"></ext:Label></ext:Cell>
    <ext:Cell ColSpan="2"><ext:Checkbox ID="Card_Default" runat="server" StyleSpec="margin: 0px 0px 4px 4px;" /></ext:Cell>
    
    
    </ext:TableLayout>
    </Body></ext:Panel>
    </ext:Anchor>                                              
                                </ext:FormLayout>
                            </Body>
                        </ext:Panel>
                    </ext:Anchor>
                </ext:FormLayout>
            </Body>
        </ext:Panel>
    </ext:FitLayout>
  2. #2

    RE: [CLOSED] window is slow

    Hi,

    You make AjaxEvent to show window. Please note that in this case the delay will consist the following items:

    1. network request performing delay
    2. on server side the page will be recreated (to perform your request) and full page life cycle will be performed. If your page is heavy and retrieve data from DB then it can be long time

    Therefore I recommend to use javascript to show window (of course if you don't need to do other server side action before the window showing)

    <ext:Button ID="Button16" runat="server"  Text="Insert" Icon="Add">
        <Listeners>
             <Click Handler="#{win_card}.show();" />
        </Listeners>
    </ext:Button>
    I assume that win_card is Window with ID="win_card"

  3. #3

    RE: [CLOSED] window is slow

    thanks
    it works much better

Similar Threads

  1. [CLOSED] Slow window resize in IE9
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 11, 2012, 11:25 AM
  2. Ext.Net and slow connection
    By threewonders in forum 1.x Help
    Replies: 1
    Last Post: May 17, 2012, 5:43 PM
  3. Ext.Net is Running Too Slow
    By archana in forum 1.x Help
    Replies: 5
    Last Post: Oct 03, 2011, 7:11 AM
  4. Slow rendering of Ext JS
    By westerncape1000 in forum 1.x Help
    Replies: 1
    Last Post: Sep 13, 2011, 9:43 AM
  5. [CLOSED] EventMask is slow in IE7/IE6
    By pank in forum 1.x Legacy Premium Help
    Replies: 17
    Last Post: May 26, 2009, 8:57 AM

Posting Permissions