[CLOSED] Sorry~ one more question.

  1. #1

    [CLOSED] Sorry~ one more question.

    After each call to the server to get the grid content I get a second call performed automaticaly by the Store itself calling the "onRefresh" event.
    this causes every request go twice to the server.

    first request -> no action
    Second request -> action

    but next tree node click -> previous data (first request) action.



    
    protected void Store1_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            if (X.IsAjaxRequest)
            {
                string id = e.Parameters["DrFileName"];
    
                if (id != "" || id != null)
                {
                    this.LinqDataSource1.WhereParameters["DrFileName"].DefaultValue = id ?? "-1";
                    this.Store1.DataBind();
                    X.Msg.Notify("CallBack", "NODE: " + id).Show();
                }
                else
                {
                    this.LinqDataSource1.WhereParameters["DrFileName"].DefaultValue = "-1";
                    this.Store1.DataBind();
                    X.Msg.Notify("CallBack", "NODE: " + id).Show();
                }
            }
        }
    
    
        protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e) 
        {
            e.WhereParameters["DrFileName"] = this.HiddenDrFileName.Value ?? "-1"; 
        }     
    
    
    
    <asp:LinqDataSource 
        ID="LinqDataSource1" 
        runat="server" 
        ContextTypeName="septaipcinfoDataContext"
        Select="new (OrderNo, DrNo, MaterialNo, DrName, QTY_User, Manu, DrFileName)" 
        TableName="Tbl_IPCInfos"
        Where="DrFileName == @DrFileName"
        OnSelecting="LinqDataSource1_Selecting"
        OrderBy="OrderNo asc"
        StoreOriginalValuesInViewState="true"
        >
            
        <WhereParameters>
            <asp:Parameter Name="DrFileName" DefaultValue="Septa" />
        </WhereParameters>
    </asp:LinqDataSource> 
    
    <ext:Store ID="Store1" 
            runat="server"
            AutoLoad="false"
            SerializationMode="Simple"
            DataSourceID="LinqDataSource1"                                                            
            OnRefreshData="Store1_Refresh"
            RefreshAfterSaving="Always"
            >
            <AutoLoadParams>    
                <ext:Parameter Name="start" Value="={0}" />    
                <ext:Parameter Name="limit" Value="={20}" />   
            </AutoLoadParams>
            <DirectEventConfig>            
                <EventMask ShowMask="false" />        
            </DirectEventConfig>
            <Reader>
                <ext:JsonReader>
                    <Fields>
                    <ext:RecordField Name="OrderNo" />
                    <ext:RecordField Name="DrNo" />
                    <ext:RecordField Name="MaterialNo" />                   
                    <ext:RecordField Name="DrName" />           
                    <ext:RecordField Name="QTY_User" />
                    <ext:RecordField Name="Manu" />  
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <BaseParams>
                <ext:Parameter 
                    Name="DrFileName" 
                    Value="getId('#{TreePanel1}')"
                    Mode="Raw" 
                    />
            </BaseParams>
    </ext:Store>
    <ext:Hidden ID="HiddenDrFileName" runat="server" />      
    
    
    <ext:TreePanel 
                ID="TreePanel1"
                runat="server" 
                Region="West"
                Width="300" 
                MinWidth="300" 
                MaxWidth="600"
                Split="true"
                Title="Septa IPC" 
                Icon="BookOpenMark" 
                AutoScroll="True" 
                Animate="True"
                UseArrows="True" 
                CollapseFirst="false" 
                ContainerScroll="true"
                Collapsible="true"
                Flex="1"
                RootVisible="false"                             
                IDMode="Explicit">    
    <Click Handler="if (node.attributes.qtip){                                     
                                        #{HiddenDrFileName}.setValue(getId(this.id));
                                        #{Store1}.reload(); 
                                        #{East}.expand();
                                        e.stopEvent(); loadPage(#{Pages}, node);
                                        }
                                        " />   
    
    
    <ext:GridPanel
                            ID="GridPanel1" 
                            runat="server"
                            RemoteSort="true" 
                            Border="false" 
                            StripeRows="true"
                            Margins="0 0 5 5"
                            Icon="Table" 
                            Title="Part List"
                            Frame="True" 
                            BufferResize="250" 
                            StoreID="store1"
                            SelectionMemory="Disabled"
                            >
    Last edited by geoffrey.mcgill; Apr 12, 2012 at 1:19 AM. Reason: [CLOSED]
  2. #2
    Hi,

    The thread is related to:
    http://forums.ext.net/showthread.php?18195

    Regarding the question.

    Not sure that I understand the problem well. Though please try to configure the Store with PageProxy.

    Example
    <ext:Store runat="server">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
    </ext:Store>

Similar Threads

  1. [CLOSED] [1.0] Question on
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 11, 2010, 7:49 AM
  2. [CLOSED] VTypes Question
    By bruce in forum 1.x Help
    Replies: 7
    Last Post: Feb 18, 2009, 9:48 AM
  3. [CLOSED] EventMask question
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 13, 2009, 11:11 AM
  4. [CLOSED] svn question
    By pkellner in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 24, 2008, 9:59 AM
  5. [CLOSED] AjaxEvents Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 01, 2008, 5:48 PM

Posting Permissions