Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Error in remote paging
posted

Hello everyone,

I m facing error while performing manual paging. I m getting this error.

Controller: (Datasourceurl)

// Class for storing result and totalcount.

class Res
{
public IEnumerable<Student> Records { get; set; }
public int TotalRecordsCount { get; set; }
}

public JsonResult Data()
{


var absolutepath1 = Request.QueryString.Value;
NameValueCollection parse1 = HttpUtility.ParseQueryString(absolutepath1);
int skip = Convert.ToInt32(parse1["$skip"]);//number of rows to skip
int top = Convert.ToInt32(parse1["$top"]);// entries to be displayed

IEnumerable<Student> s12

if (skip != null && top != null)
{

s12= data.GetStudents();
s12 = s12.Skip(skip).Take(top).ToList();

Res r1 = new Res();
r1.Records = s12;
r1.TotalRecordsCount = s12.Count();


return Json(r1);

}

return Json(s12);

}

CSHtml:

$(function () {
$("#grid").igGrid({
primaryKey: "id",
renderCheckboxes: true,
autoGenerateColumns: false,
updateUrl: "/Student/put/",
width: "100%",

columns: [
{ headerText: "Student ID", key: "id", dataType: "number", width: "15%" },
{ headerText: "Student Name", key: "name", dataType: "string", width: "30%" },
{ headerText: "Marks", key: "marks", dataType: "number", width: "30%" },
{
headerText: "Image",
key: "imagepath",
dataType: "string",
width: "15%",
template: "<img src='${imagepath}' width='50' height='50' />"
},
{ headerText: "Subject", key: "subject", dataType: "string", width: "15%" }
],
dataSourceUrl: "/Student/Data12",
dataSource: "/Student/Data",
responseDataKey: "Records",


features: [
{
name :"Paging",
type:"remote",
pageSize: 7,
visiblePageCount:5,
recordCountKey: "TotalRecordsCount"
}

IMPORTED CDN:

<link href="">cdn-na.infragistics.com/.../infragistics.theme.css" rel="stylesheet" type="text/css" />
<link href="">cdn-na.infragistics.com/.../infragistics.css" rel="stylesheet" type="text/css" />
<script src="">ajax.googleapis.com/.../jquery.min.js" type="text/javascript"></script>
<script src="">ajax.googleapis.com/.../jquery-ui.min.js" type="text/javascript"></script>

<script src="">cdn-na.infragistics.com/.../infragistics.core.js" type="text/javascript"></script>
<script src="">cdn-na.infragistics.com/.../infragistics.lob.js" type="text/javascript"></script>

I cannot figure the reason for this error.Please help me fix it.

Thanks and Everyone.

  • 700
    Offline posted

    Hello Rohit,

    Thank you for posting in our community!

    I have been looking into your question, however, I am not able to identify what error you are receiving on your side.

    Additionally, I have noticed that a similar question regarding the igGridPaging remote capability has already been asked in the following forum post here where I have already provided an answer along with a test sample.

    Also, I have included a working MVC sample in the following answer here in order for you to test it on your side and be able to compare the code configuration to your own project.

    Furthermore, please note that according to our support policy we handle a single thread per issue. This is for better history tracking and helps us ensure that all issues are addressed and handled correctly.

    Having this in mind, I would suggest addressing your questions regarding the igGridPaging feature’s remote capabilities in the original forum post where I will continue assisting you. There you could provide further details regarding the error that you are receiving, for example, a screenshot or a small working sample that I can debug on my side.

    Thank you for your cooperation.

    Sincerely,
    Riva Ivanova
    Associate Software Developer