[CLOSED] Infinite Scrolling with MVC

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Infinite Scrolling with MVC

    Hi folks, i´m trying to implement a Grid with infinite scrolling using mvc. I tried to do it using https://examples2.ext.net/#/GridPane.../Forum_topics/ as example but i was not able to accomplish this task

    The function LoadRecords is called but the records are loaded in the grid.

    Could someone give me directions to overcome this problem?

    Thanks in advance

    View
    <ext:Panel ID="Panel1" runat="server" PreventHeader="true" Border="false">
        <Loader ID="Loader1" runat="server" Mode="Component" AutoLoad="true" Url="/Example/Internal/">
            <Params>
                <ext:Parameter Name="containerId" Value="Panel1" Mode="Value" />
            </Params>
            <LoadMask ShowMask="true" />
        </Loader>
    </ext:Panel>
    Interface Generator
    public ContentResult Internal(string containerId)
    {
        //Grid
        GridPanel grd = new GridPanel { ID = "_grd", Title = "example", Height = 200 };
        grd.Listeners.AfterRender.Handler = "alert('Saldanha'); var me = this; me.store.prefetch({start: 0, limit: 99, callback: function() { me.store.guaranteeRange(0, 49); }});";
        grd.Listeners.AfterRender.Delay = 100;
                      
        //Proxy
        JsonPProxy proxy = new JsonPProxy();
        proxy.Reader.Add(new JsonReader { Root = "data", TotalProperty = "total" });
        proxy.Url = "/Example/Test/";
    
        //Store
        Store str = new Store { ID = "_str", AutoLoad = false, Buffered = true };
        str.Proxy.Add(proxy);
        grd.Store.Add(str);
    
        //Model
        Model mdl = new Model { IDProperty = "ID" };
        addColumn("ID", grd, mdl);
        addColumn("Name", grd, mdl);
        str.Model.Add(mdl);
    
        //Result
        ContentResult r = new ContentResult();
    
        r.Content = ComponentLoader.ToJson(grd);
    
        return r;
    }
    
    private void addColumn(string id, GridPanel grd, Model mdl)
    {
        ModelField mdf = new ModelField(id);
    
        Column cln = new Column { ID = id, DataIndex = id, Sortable = true, Text = string.Format("_cln{0}", id) };
    
        if (id == "ID")
        {
            mdl.IDProperty = id;
        }
    
        mdl.Fields.Add(mdf);
    
        grd.ColumnModel.Columns.Add(cln);
    }
    Data Load
    public StoreResult Test(int start, int limit)
    {
        List<Person> lst = new List<Person>();
    
        for (int index = 0; index < limit; index++)
        {
            lst.Add(new Person { ID = index, Name = "Ext" + (start + index) });
        }
        return new StoreResult(lst, limit);
    }
    Entity
    public class Person
    {
        public int ID { get; set; }
    
        public string Name { get; set; }
    }
    Last edited by Daniil; Apr 12, 2012 at 6:29 PM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] Infinite Scrolling
    By rnachman in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 09, 2012, 5:03 PM
  2. [CLOSED] Infinite Scrolling Grid with GridFilter feature - JavaScript Error
    By MacGarnicle in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Apr 04, 2012, 2:06 PM
  3. [CLOSED] Infinite Scrolling
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 09, 2011, 6:15 PM
  4. [CLOSED] Tab Content Scrolling
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 02, 2009, 1:21 PM
  5. [CLOSED] Tab Scrolling
    By Immobilmente in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Dec 23, 2008, 5:09 PM

Posting Permissions