jqGrid: no such method: resetSelection

542 Views Asked by At

I'm using strongly typed helper for jqGrid - Lib.Web.Mvc

I can't force jqGrid to sort my data. When I click on arrow in the header, I get the following error in Firebug:

uncaught exception: jqGrid - No such method: resetSelection

also when I click on cell in the row I get:

uncaught exception: jqGrid - No such method: setSelection

This is my js code:

@{
      var grid = new Lib.Web.Mvc.JQuery.JqGrid.JqGridHelper<ViolationViewModel>("products",
      dataType: Lib.Web.Mvc.JQuery.JqGrid.JqGridDataTypes.Json,
      methodType: Lib.Web.Mvc.JQuery.JqGrid.JqGridMethodTypes.Post,
      pager: true,
      rowsNumber: 5,
      sortingName: "Id",
      sortingOrder: Lib.Web.Mvc.JQuery.JqGrid.JqGridSortingOrders.Asc,
      url: Url.Action("Violation", "Cabinet"),
      viewRecords: true,
      rowsList: new List<int>() { 5, 10, 20, 30, 50, 100 },
      autoWidth: true,
      loadOnce: true,
      rowsNumbers: true
    );
}

I'm using loadOnce option.

This code in action:

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Violation(JqGridRequest request)
        {
            JqGridResponse response = new JqGridResponse()
                {
                    TotalRecordsCount = 7
                };
            response.Records.Add(new JqGridRecord<ViolationViewModel>("1", new ViolationViewModel
                {
                    Id = 1,
                    Name = "Test1"
                }));

            response.Records.Add(new JqGridRecord<ViolationViewModel>("2", new ViolationViewModel
            {
                Id = 2,
                Name = "Test2"
            }));

            response.Records.Add(new JqGridRecord<ViolationViewModel>("3", new ViolationViewModel
            {
                Id = 3,
                Name = "Test3"
            }));

            response.Records.Add(new JqGridRecord<ViolationViewModel>("4", new ViolationViewModel
            {
                Id = 4,
                Name = "Test4"
            }));

            response.Records.Add(new JqGridRecord<ViolationViewModel>("5", new ViolationViewModel
            {
                Id = 5,
                Name = "Test5"
            }));

            response.Records.Add(new JqGridRecord<ViolationViewModel>("6", new ViolationViewModel
            {
                Id = 6,
                Name = "Test6"
            }));

            response.Records.Add(new JqGridRecord<ViolationViewModel>("7", new ViolationViewModel
            {
                Id = 7,
                Name = "Test7"
            }));

            return new JqGridJsonResult() { Data = response };
        }
0

There are 0 best solutions below