Q: JQGrid Pagination event,getting error Need help on JQGrid pagination.
Below is the piece of code,
ERR LINE : var currentPage = $('#gridData').getGridParam('page'); 
ERR MSG  :0x800a01b6 - microsoft jscript runtime error object doesn't support this property or method.
I Have checked the Jquery references also..Everything is fine. Dont know where it is going wrong :(
$("#gridData").jqGrid({
    data: selectedTblData.Table.Rows,
    datatype: "local",
    toppager: true,
    height: "100%",
    width: (selectedTblData.Table.Width < 1000) ? 985 : "100%",
    altRows: true,
    altclass: "custom-alt-row",
    colNames: selectedTblData.Table.colNames,
    colModel: selectedTblData.Table.colModel,
    multiselect: false,
    rowNum: 25,
    rowList: [15, 25, 50, 75, 100],
    mtype: 'GET',
    pager: '#pager',
    sortname: selectedTblData.Table.colNames[0],
    sortorder: "asc",
    viewrecords: true,
    shrinkToFit: (selectedTblData.Table.Width < 1000),
    caption: tableName,
    secureUri: false,
    contentType: "application/json; charset=utf-8",
    loadonce: true,
    //BS Page start
    onPaging: function (pgButton) {
        //debugger;


        var pagerId = this.p.pager.substr(1); // get paper id like "pager"
        var currentPage = $('#gridData').getGridParam('page'); //get current  page
        var lastPage = $("#gridData").getGridParam("lastpage"); //get last page 

        if (currentPage - 1 == lastPage - 1)
            $("#gridData").setGridParam({ page: lastPage }).trigger("reloadGrid"); // set the requested page to the last page value – then reload

        var currentRecordCount = $("#gridData").getGridParam("reccount");  //get the record count
        var recordsPerPage = $("#gridData").getGridParam("rowNum");  // get the records per page
        var newValue = 0;  // new value
        if (pgButton === "user") {
            newValue = $(".ui-pg-input").val(); 
        }
        else {

            if (pgButton.indexOf("next") >= 0)
                newValue = ++currentPage;
            else if (pgButton.indexOf("prev") >= 0)
                newValue = --currentPage;
            else if (pgButton.indexOf("last") >= 0)
                newValue = $("#gridId").getGridParam('lastpage');
            else if (pgButton.indexOf("first") >= 0)
                newValue = 1;
        }
        alert(newValue);
        $("#gridData").setGridParam({ page: newValue }).trigger("reloadGrid");  // set the requested page to the last page value – then reload
        currentRecordCount = $("#gridData").getGridParam("reccount");  // read the current page records
        alert('RecordCount: ' + currentRecordCount + ' RecordsPerPage: ' + recordsPerPage);

        if (currentRecordCount < recordsPerPage) {
            startRange = 1;
            endRange += endRange;

            jQuery("#gridData").jqGrid("setGridParam", { datatype: "json", data: "{TableName :'" + tableName + "'}", url: "TablesCoolView.aspx/GetTableData" }).trigger("reloadGrid");
        }
    }
    //BS page end
});


A: There is inconsistences with how you are calling the jqGrid methods. If I recall correctly, earlier versions of jqGrid used the 
jQuery("#grid_id").jqGridMethod( parameter1,...parameterN );

way of calling methods, but I do believe the new API expect you to use th
jQuery("#grid_id").jqGrid('method', parameter1,...parameterN );

so in your specific case, the way you are calling setGridParam on the last line is the best way
jQuery("#gridData").jqGrid("setGridParam", { datatype: "json", data: ...

so you code that is like
$("#gridId").getGridParam('lastpage');

is not valid in the new API. (i.e. should be 
jQuery("#gridData").jqGrid("getGridParam", 'lastpage');

Now this change was about version 3.6, so what version are you using as you seem to be mixing methods
ref jqGrid methods
Although to be honest, I was reasonable positive that both methods were OK, but judging by your error message, the $('#gridData').getGridParam('page'); is throwing the error because $('#gridData') doesn't have a method getGridParam, so I would try the other way
