[CLOSED] Sorting does not work after adding Buffered in GridPanel

  1. #1

    [CLOSED] Sorting does not work after adding Buffered in GridPanel

    Seems bug to me, but Sorting does not work after setting Buffered(True) in GridPanel. Can anyone please help me with this?

    I don't think you need my example to see this bug. If you do need then let me know.

    Thanks,
    Puneet
  2. #2
    Hello Puneet!

    I believe you could at least point an example in examples explorer which you get the issue once you enable the buffering you are talking about? That would help pinpointing the issue in a shorter term.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    And hello again!

    I didn't notice any problem sorting entries on this buffered grid, "infinite scrolling" example: GridPanel -> Infinite Scrolling -> Buffered GridPanel
    Fabrício Murta
    Developer & Support Expert
  4. #4
    I was following same example in MVC explorer.

    http://mvc.ext.net/#/GridPanel_Infin...red_Scrolling/

    Here's my code:

    InfiniteScrolling.vbhtml view
    /Home/InfiniteScrolling
    @ModelType System.Collections.IEnumerable
    
    @(Html.X().ResourceManager())
    @(
        ViewBag.Title = "Buffered Scrolling - Ext.NET MVC Examples"
    )
    
        <h1>Buffered Scrolling</h1>
    
        <p>Introduced with Ext.Net 2.0, grid supports infinite scrolling, which enables you to load any number of records into a grid without paging.</p>
    
        <p>This grid approach uses a virtualized scrolling system to handle potentially infinite data sets without any impact on client side performance.</p>
    
        <p>This example illustrates loading of all the records up front and buffering the rendered grid.</p>
    
        <script>
            var go = function () {
                var me = this,
                    field = me.up('toolbar').down('#gotoLine');
    
                if (field.isValid()) {
                    me.up('grid').view.bufferedRenderer.scrollTo(field.getValue() - 1, true);
                }
            };
        </script>
    
    @(Html.X().GridPanel() _
            .Title("Buffered Grid of 5,000 random records") _
            .Width(700) _
            .Height(500) _
            .Store(Html.X().Store() _
                .PageSize(5000) _
            .Buffered(True) _
            .DataSource(Model) _
            .Model(Html.X().Model() _
                    .Fields( _
                        New ModelField("id"), _
                        New ModelField("name"), _
                        New ModelField("rating", ModelFieldType.Int), _
                        New ModelField("salary", ModelFieldType.Float) _
                    ) _
                ) _
            ).Plugins(Html.X().BufferedRenderer) _
            .View(Html.X().GridView().TrackOver(False)) _
            .ColumnModel( _
                Html.X().RowNumbererColumn().Width(140), _
                        Html.X().Column().Text("Name").Flex(1).DataIndex("name"), _
                        Html.X().Column().Text("Rating").Width(125).DataIndex("rating"), _
                Html.X().Column() _
                    .Text("Salary") _
            .Width(125) _
            .DataIndex("salary") _
            .Align(Alignment.Right) _
            .Renderer(RendererFormat.UsMoney) _
            .Sortable(False) _
            ) _
            .SelectionModel(Html.X().RowSelectionModel().PruneRemoved(False)) _
            .BottomBar(Html.X().Toolbar() _
                .Items( _
                    Html.X().NumberField() _
                        .FieldLabel("Jump to row") _
            .MinValue(1) _
            .MaxValue(5000) _
            .AllowDecimals(False) _
            .ItemID("gotoLine"), _
                    Html.X().Button() _
            .Text("Go") _
            .Listeners(Sub(ls) ls.Click.Fn = "go" _
            ) _
                ) _
            ))
    Home Controller

    Imports System.Web.Mvc
    Imports System.Linq
    Imports ExtNETExamples.ExtNETExamples
    Imports Ext.Net.MVC
    Imports Ext.Net
    
    Namespace Controllers
        Public Class HomeController
            Inherits Controller
    
           Function InfiniteScrolling() As ActionResult
                Return View(companyModel.GetData())
            End Function
        End Class
    End Namespace
    CompanyModel.vb
    
    Imports System.Collections
    Imports System.Collections.Generic
    
    Namespace ExtNETExamples
        Public Class CompanyModel
            Public Shared Function GetData() As IEnumerable
    	        Dim firstNames = New String() {"Russel", "Clark", "Steve", "Sam", "Lance", "Robert", _
    		        "Sean", "David", "Justin", "Nicolas", "Brent"}
    	        Dim lastNames = New String() {"Wood", "Lewis", "Scott", "Parker", "Ross", "Garcia", _
    		        "Bell", "Kelly", "Powell", "Moore", "Cook"}
    
    	        Dim ratings = New Integer() {1, 2, 3, 4, 5}
    	        Dim salaries = New Integer() {100, 400, 900, 1500, 1000000}
                Dim count As Integer  = 50000
    	        Dim data = New Object(count - 1) {}
    	        Dim rnd = New Random()
    
    	        For i As Integer = 0 To count - 1
    		        Dim ratingId = rnd.[Next](ratings.Length)
    		        Dim salaryId = rnd.[Next](salaries.Length)
    		        Dim firstNameId = rnd.[Next](firstNames.Length)
    		        Dim lastNameId = rnd.[Next](lastNames.Length)
    
    		        Dim rating = ratings(ratingId)
    		        Dim salary = salaries(salaryId)
    		        Dim name = [String].Format("{0} {1}", firstNames(firstNameId), lastNames(lastNameId))
    		        Dim id = "rec-" + i.ToString()
    
    		        data(i) = New Object() {id, name, rating, salary}
    	        Next
    
    	        Return data
            End Function
        End Class
    End Namespace
    Not sure why it is not working for me.
  5. #5
    Hello!

    Got it, thanks! I should have looked at the MVC example. Interesting enough, but unexpected, the example showed unnecessary differences between its WebForms counterpart. I've just updated the samples to reflect the WebForms' usage now.

    Basically for the code sample you provided, get rid of lines 32 and 33 of your view. A buffered store would not combine well with a buffered scroller. That's why in MVC example it used to have scrolling disabled. Although it once worked for Ext.NET v2, it is no longer the case.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 21
    Last Post: Apr 27, 2016, 2:40 AM
  2. Replies: 5
    Last Post: Apr 27, 2016, 12:43 AM
  3. [CLOSED] Dynamically adding a node does not work
    By extnetuser in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 27, 2013, 9:41 AM
  4. [CLOSED] Grouped Buffered GridPanel won't Collapse
    By stratadev in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 23, 2013, 3:46 AM
  5. Replies: 5
    Last Post: Dec 14, 2012, 5:07 PM

Posting Permissions