IFrame: Gridpanel focus

  1. #1

    IFrame: Gridpanel focus

    Hello,
    Please consider following code. Could you please help me to know why it does not focus the gridpanel once it finish executing the direct method.

    I have also tried following in B.aspx.cs

    X.AddScript("parent.Panel9.getBody().GridPanel1.focus();");
    I am using IE 9.

    Thanks in advance.


    Main.aspx

    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
            <Items>
                <ext:Panel ID="Panel1" runat="server" Collapsible="True" Height="100" Region="North"
                    Split="True" Title="North">
                    <Items>
                    </Items>
                </ext:Panel>
                <ext:Panel ID="Panel2" runat="server" Collapsible="true" Layout="Fit" Region="East"
                    Split="true" Title="East" Width="175">
                    <Items>
                        
                    </Items>
                </ext:Panel>
                <ext:Panel ID="Panel5" runat="server" Collapsible="true" Height="300" Region="South"
                    Split="true" Title="South">
                    <Items>
                    </Items>
                </ext:Panel>
                <ext:Panel ID="Panel6" runat="server" Collapsible="true" Region="West" Layout="Fit"
                    Split="true" Title="West" Width="175">
                        <AutoLoad Url="~/B.aspx" Mode="IFrame" ShowMask="true" />
                </ext:Panel>
                <ext:Panel ID="Panel9" runat="server" Layout="Fit" Region="Center" >
                    <AutoLoad Url="~/A.aspx" Mode="IFrame" ShowMask="true" />
                </ext:Panel>
            </Items>
        </ext:Viewport>
    A.aspx

    <ext:GridPanel ID="GridPanel1" runat="server" StripeRows="true" Title="Array Grid"
            TrackMouseOver="true" AutoHeight="true" AutoExpandColumn="company">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Reader>
                        <ext:ArrayReader>
                            <Fields>
                                <ext:RecordField Name="company" />
                                <ext:RecordField Name="price" Type="Float" />
                                <ext:RecordField Name="change" Type="Float" />
                                <ext:RecordField Name="pctChange" Type="Float" />
                                <ext:RecordField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column ColumnID="Company" Header="Company" DataIndex="company" />
                    <ext:Column Header="Price" DataIndex="price" />
                    <ext:Column ColumnID="Change" Header="Change" DataIndex="change" />
                    <ext:Column Header="Change" DataIndex="pctChange" />
                    <ext:DateColumn Header="Last Updated" DataIndex="lastChange" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                    <DirectEvents>
                        <RowSelect OnEvent="GridPanelRowSelected" Delay="10">
                            <ExtraParams>
                                <ext:Parameter Name="SelectedRows" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly : true}))"
                                    Mode="Raw">
                                </ext:Parameter>
                            </ExtraParams>
                        </RowSelect>
                    </DirectEvents>
                </ext:RowSelectionModel>
            </SelectionModel>
        </ext:GridPanel>
    A.aspx.cs

    protected void GridPanelRowSelected(object sender, DirectEventArgs e)
            {
                RowSelectionModel sm = GridPanel1.SelectionModel.Primary as RowSelectionModel;
    
                List<string> list = new List<string>();
                list.Add(sm.SelectedRows[0].RowIndex.ToString());
    
                X.Call("parent.Panel6.getBody().Ext.net.DirectMethods.RefreshPropertyGrid", list);
            }

    B.aspx

    <ext:PropertyGrid ID="PropertyGrid1" runat="server">
    </ext:PropertyGrid>


    B.aspx.cs

    [DirectMethod]
            public void RefreshPropertyGrid(List<string> list)
            {
                //Do something
                System.Threading.Thread.Sleep(20000);
            }
    Last edited by mrd; Jul 23, 2012 at 12:32 PM.
  2. #2
    Hi,

    Use instead of :
    X.Call("parent.Panel6.getBody().Ext.net.DirectMethods.RefreshPropertyGrid", list);
    this :
    X.Call("parent.App.direct.RefreshPropertyGrid", list);

Similar Threads

  1. [CLOSED] focus on first cell in new record gridpanel
    By albayrak in forum 1.x Premium Help
    Replies: 6
    Last Post: Jan 09, 2014, 4:40 AM
  2. GridPanel cell focus
    By Dominik in forum 1.x Help
    Replies: 12
    Last Post: Mar 02, 2012, 11:21 AM
  3. [CLOSED] How to Focus to the Next Editor in a GridPanel Row?
    By iansriley in forum 1.x Premium Help
    Replies: 1
    Last Post: Sep 22, 2010, 9:18 PM
  4. [CLOSED] GridPanel selected focus
    By speedstepmem2 in forum 1.x Premium Help
    Replies: 1
    Last Post: Jun 16, 2009, 9:08 AM
  5. Replies: 2
    Last Post: May 14, 2009, 5:35 PM

Tags for this Thread

Posting Permissions