can not get DataSourceProxy to work

  1. #1

    can not get DataSourceProxy to work

    Hi,
    I am trying to make nearly the exact implementation of the sample "Paging And Sorting" on the examples page.
    but, when i put the DataSourceProxy item in ext:Store, i get an empty result set.

    If i remove it, i get only the 10 records (which is the limit in my case).
    You can see the following code for the sample, but its not much different than the sample.
    Any suggestions for that behaviour ?
    Thanks.

        <asp:ObjectDataSource ID="ObjectDataSource1" SelectMethod="GetMyList"
            OnSelected="ObjectDataSource1_Selected" TypeName="oo.ObjectData" runat="server">
            <SelectParameters>
                <asp:Parameter Name="start" DefaultValue="1" Type="Int32" />
                <asp:Parameter Name="limit" DefaultValue="10" Type="Int32" />
                <asp:Parameter Name="sort" DefaultValue="" />
                <asp:Parameter Name="dir" DefaultValue="" />
                <asp:Parameter Name="count" Direction="Output" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    
        <ext:Store ID="Store1" runat="server" AutoLoad="true" RemoteSort="true" DataSourceID="ObjectDataSource1">
            <Proxy>
                <ext:DataSourceProxy />
            </Proxy>
            <Reader>
                <ext:JsonReader ReaderID="id">
                    <Fields>
                        <ext:RecordField Name="FirstName" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    
    
    
    namespace oo
    {
        using System;
        using System.Collections.Generic;
        using System.Linq;
        using System.Web;
        using System.Data;
        using Microsoft.Practices.EnterpriseLibrary.Data;
        using System.Data.Common;
        
        public class ObjectData
        {
            public static DataTable GetMyList(
                int start, 
                int limit, 
                string sort, 
                string dir,
                out int count
                )
            {
    
                try
                {
                    Database db = DatabaseFactory.CreateDatabase();
                    string sqlCommand = "SP_GetMyList";
                    DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);
    
                    db.AddInParameter(dbCommand, "start", DbType.Int32, start);
                    db.AddInParameter(dbCommand, "limit", DbType.Int32, limit);
                    db.AddInParameter(dbCommand, "sort", DbType.String, sort);
                    db.AddInParameter(dbCommand, "dir", DbType.String, dir);
                    db.AddOutParameter(dbCommand, "TotalCount", DbType.Int32, count);
    
                    ds = db.ExecuteDataSet(dbCommand);
    
                    count = Convert.ToInt32(db.GetParameterValue(dbCommand, "TotalCount"));
                }
                catch (Exception ex)
                {
                    ExceptionManager.Publish(ex);
                }
                return ds.Tables[0];
            }
        }
    }

  2. #2

    RE: can not get DataSourceProxy to work

    Hi,

    You must define OnRefreshData handler and rebind data in this handler. In example it is shown.


    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: can not get DataSourceProxy to work

    OK Thanks, Solved.

Similar Threads

  1. Ext.Net does not work under IE9
    By nov30th in forum 1.x Help
    Replies: 13
    Last Post: Feb 14, 2012, 10:08 AM
  2. MVC Ext.Net isn't work
    By flaviodamaia in forum Bugs
    Replies: 2
    Last Post: Jun 30, 2010, 5:44 PM
  3. DataSourceProxy Export
    By simonmicheal in forum 1.x Help
    Replies: 3
    Last Post: Oct 21, 2009, 12:26 PM
  4. Replies: 2
    Last Post: Mar 16, 2009, 2:50 PM
  5. [CLOSED] GridPanel DataSourceProxy
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 17
    Last Post: Feb 23, 2009, 3:09 PM

Posting Permissions