Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6540329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:57:55+00:00 2026-05-25T10:57:55+00:00

My problem is that while trying to implement usage of the Autoload feature, I

  • 0

My problem is that while trying to implement usage of the Autoload feature, I cannot get it to make GET requests to my Action at all to attempt to load the next set of data. The first initial load works fine

I tried following the example here http://trirand.com/blog/jqgrid/jqgrid.html

The feature is listed under the item on the left hand side titled New in Version 3.4 – Autoloading when scrolling

What is the mistake here?

Here is my js grid code

<script type='text/javascript'>
$(document).ready(function()
{
   $('#gvEmps').jqGrid(
   {
      url:'RecordEmpGrid',
      datatype: 'json',
      colNames:['Select Training(s)'],
      colModel :
      [
         {name: 'Select Training(s)', index: 'TrainingName', width: '300', align: 'Left'}
      ],
   rowNum: 15,
   scroll: true,
   rowList:[10,20,30],
   pager: '#gvEmpsPager',
   sortname: 'TrainingName',
   viewrecords: true,
   sortorder: 'desc',
   jsonReader:
   {
      repeatitems : true,
   },
   caption: ''
});
});
</script>

Html

<table id="gvEmps" class="SGrid scroll"></table>
<div id="gvEmpsPager" class="scroll"></div>

Controller

    //will never hit this action when scrolling, only first time on page load
    [HttpGet]
    public ActionResult RecordEmpGrid(string sidx, string sord, int page, int rows)
    {
        var gr = new GridResult(sidx, sord, page, rows);
        var skip = rows * page - rows;
        DataTable dt = null;
        using (var mr = new MultipleRecords(Product.Utility, "evaluateSql"))
        {
            mr["sql"] = "SELECT * FROM TT.Training WHERE CompanyId = 190 ORDER BY TrainingName ASC";
            dt = mr.GetDataTable();
        }
        gr.Total = dt.Rows.Count;
        var records = new MultipleRecords(dt);
        foreach (var row in records.Skip(skip).Take(rows))
        {
            gr.AddDataRow(new []{row["TrainingTypeID"].String, row["TrainingName"].String });
        }
        return Json(gr.Data, JsonRequestBehavior.AllowGet);
    }

My json wrapper object

public class GridResult
{
    private List<object> m_rowData = new List<object>();

    private string m_order;
    private string m_idx;
    private int m_rows;
    private int m_page;

    public int Total { get; set; }

    public GridResult()
    {

    }

    public GridResult(string sidx, string sord, int page, int rows)
    {
        m_idx = sidx;
        m_order = sord;
        m_page = page;
        m_rows = rows;
    }

    public void AddDataRow(object[] columnData)
    {
        m_rowData.Add(columnData);
    }

    private object m_data;
    public object Data
    {
        get
        {
            return m_data ?? (m_data = BuildData());
        }
    }

    protected object BuildData()
    {
        var id = 1;
        return new
        {
            total = Total,
            page = m_page++,
            records = m_rows,
            rows = (from row in m_rowData
                    select new
                    {
                        id = id++,
                        cell = row
                    }
                    ).ToArray()
        };
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:57:56+00:00Added an answer on May 25, 2026 at 10:57 am

    The issue was inside my json helper object. I blame poor naming conventions for this but it appears that I was mixing the records & total parameters up.

    total = //Number of records of the page
    records = //Total number of records that can be loaded
    
    
    protected object BuildData()
    {
        var id = 1;
        return new
        {
            total = _rows, // <-- Number of rows total for a page limit (15 in my case)
            page = m_page++,
            records = Total, //<-- Total number of records possible to load (121 in my case)
            rows = (from row in m_rowData
                    select new
                    {
                        id = id++,
                        cell = row
                    }
                    ).ToArray()
        };
    }
    

    switching those two solved the problem.

    Here is a great link that lead me to the discovery. This guy is a jqGrid guru.

    http://blogs.teamb.com/craigstuntz/2009/04/15/38212/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently ran across this problem while trying to implement a service that has
In trying to implement the repository pattern I've run into a minor problem that
I have to display Datetime in my gridview, the problem is that while I
The problem is that GA sometimes takes a little while to load, and my
I'm facing a problem while unit testing my forms. The problem is that data
I'm trying to get familiar with CI and I have run into a problem
Hey guys, I'm currently trying to implement a function using C that takes in
Problem statement: Implement a plug-in system that allows the associated assemblies to be overwritten
I'm new to C++ and trying to implement a turtle emulator that will read
I am trying to implement a simple HashTable in Java that uses a Linked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.