jQWidgets Forums

jQuery UI Widgets Forums Grid Grid server side pagination

This topic contains 5 replies, has 2 voices, and was last updated by  Hristo 4 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Grid server side pagination #112788

    paulo.junior
    Participant

    Hello,
    I’m setting up a project here, and I’m using your jqxgrid grid. Since I have a large mass of data, I am using the concept of component page.
    However I found a question here of strange behavior, for the example you gave to .Net, in the same you use the .ToList (). Skip (pagesize * pagenum) .Take (pagesize), the result that returns, comes the correct numbering using the page arrows.
    Only when I put the amount of items displayed on the screen, it simply puts a blank line, even though the query in the filter says it has only X lines.

    Example: A grid with 5000 records I filter a column and I have the result of 1500, and in the list of items per page I have a 2000 pointer, so instead of 1500 written lines it displayed the total of 2000 lines, 1500 with records and 500 blank.

    What can this be? Is it some wrong behavior in the framework? Or is it something I’m doing wrong.

    Hugs,
    Paulo Junior

    Grid server side pagination #112802

    Hristo
    Participant

    Hello Paulo Junior,

    I tested this demo and it seems to work fine:
    https://mvcexamples.jqwidgets.com/widgets/datatable/light
    It uses the same approach the only difference is that it is created with the jqxDataTable – the name of the demo is DataTable Server Sorting, Paging and Filtering” demo in the ASP .NET MVC section.
    You could find more details in this tutorial.
    Also, I would like to ask you is there any error message?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Grid server side pagination #112805

    paulo.junior
    Participant

    Hi Hristo Hristov,
    Thanks for the quick response, yes, as I am doing on the project, it is the same as your ASP.Net documentation, except that I use a single method to do everything. But I see that when I get the result of the Filter if it has and the sorting, even if I say that I want to display only the result, what happens is that the function .Take (pagesize), is giving some conflict that in Javascript side of the component.
    Because in the backend it passes the correct result of the Filter, but for some reason as I say that I want to display X lines to see the entire result of the filter in the grid, the jqxGrid is not having the expected behavior. It does not present any error, it just is not behaving as expected. And with respect to the DataTable example you showed me, it does not fit what I’m using, because I have the option to display the number of rows on the grid, and that’s where I’m having the problem.
    Right now, I redid the display of a filter where I have a result in the BackEnd of 219 items, and I chose to display 1000 lines, then the Grid took the result of 219 that comes from C # and played it for the component, only the same it did not discard 781 blank lines, it displayed in the jqxGrid on screen, so that would be my problem, the discard that the grid is not doing.

    Best Regards,
    Paulo Junior

    Grid server side pagination #112811

    Hristo
    Participant

    Hello Paulo Junior,

    You could determinate the number of all records by the totalrecords field.
    If you want to display only that you have 1000 records then it will be better to create a custom pager.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Grid server side pagination #112814

    paulo.junior
    Participant

    Hi Hristo Hristov,
    Thanks again for the quick response, but it wouldn’t be the kind of customization I want. And my problem would not be a customization on the grid page, but a behavior that is happening when a filter is performed on it.
    I used your configuration and found out that the problem is in the pagesize, because using your personalization I put the display of 500 items per page, and when I filtered a column it returned me 281 and the grid mounted the screen with 500 lines, even I having 281 filto record.

    pagerrenderer: pagerrenderer,
    pagesize: 500,

    Hugs,
    Paulo Junior

    Grid server side pagination #112826

    Hristo
    Participant

    Hello Paulo Junior,

    It is strange.
    Please, check the place where you update the total rows – source.totalrecords.
    I tested this and this example and both work fine with this scenario.
    I look forward to hearing from you.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.