Grid Pagination loading JS Array data

I cannot get pagination to work when populating the data using grid.parse(jsObj, “json”). I can inspect the source of the page, and see the “pagingArea” span with my results, but this span is not visible on the page.

When I inspect the pagingArea span, I can see the text “Records from 1 to 9 of 9” (attached screenshot). This leads me to believe the parse method is not honoring the total_count variable in the javascript object, and instead is using the length of the rows array. Below the code is a sample of the initial object passed in to the parse method. Here is the code that creates the grid (I’m using a bit of jQuery). ctx.data is the sample object I provided:

ctx.dhtmlxGridDiv = $('<div id="itemGrid"></div>');
ctx.gridPagingDiv = $('<div><span id="pagingArea"></span>&nbsp;<span id="infoArea"></span></div>');
ctx.div.append(ctx.dhtmlxGridDiv);
ctx.div.append(ctx.gridPagingDiv);
		
ctx.grid = new dhtmlXGridObject("itemGrid");
ctx.grid.setImagePath("dhtmlx/imgs/");
ctx.grid.setHeader(ctx.data.columnNames);
	 
ctx.grid.setSkin("light");
	 
ctx.grid.init();
ctx.grid.parse(ctx.data,"json");
ctx.grid.enablePaging(true,10,10,"pagingArea",true,"infoArea");
ctx.grid.setPagingSkin("bricks");
{

    "columnNames": [
        "File Type",
        "Path Name",
        "Item Date"
    ],
    "total_count": 7035,
    "rows": [
        {
            "id": 1,
            "data": [
                "Empty File",
                "blah",
                "Wednesday, December 19, 2001 11:59:44 AM EST"
            ]
        },
        {
            "id": 2,
            "data": [
                "Inaccessible Content",
                "/blah",
                "Friday, May 4, 2001 5:13:00 PM EDT"
            ]
        },
        {
            "id": 3,
            "data": [
                "Microsoft OLE2 Standard Link",
                "blah",
                "Wednesday, May 2, 2001 1:27:00 PM EDT"
            ]
        },
        {
            "id": 4,
            "data": [
                "Microsoft OLE2 Standard Link",
                "blah",
                "Wednesday, October 24, 2001 1:43:38 PM EDT"
            ]
        },
        {
            "id": 5,
            "data": [
                "Empty File",
                "blah",
                "Thursday, June 7, 2001 7:09:47 PM EDT"
            ]
        },
        {
            "id": 6,
            "data": [
                "Microsoft OLE2 Standard Link",
                "blah",
                "Wednesday, January 10, 2001 2:43:00 PM EST"
            ]
        },
        {
            "id": 7,
            "data": [
                "Microsoft OLE2 Standard Link",
                "blah",
                "Tuesday, November 6, 2001 7:21:41 PM EST"
            ]
        },
        {
            "id": 8,
            "data": [
                "Inaccessible Content",
                "blah",
                "Monday, December 13, 2010 10:51:03 PM EST"
            ]
        },
        {
            "id": 9,
            "data": [
                "Inaccessible Content",
                "blah",
                "Friday, February 8, 2002 11:44:58 AM EST"
            ]
        }
    ],
    "pos": 0

}

All of the examples I’ve found use “grid.load(url)” as the way of getting data into the grid. This is not an option for me as I’m up against the browser cross domain issue.

Is there a way to set the total count of the pagination programmatically? Does “total_count” need to be named differently in the parse method?

Please check if you have attached dhtmlxgrid_json.js to your page