Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Client side pagination is not working in jqGrid

Client side pagination is not working in jqGrid

Scheduled Pinned Locked Moved ASP.NET
javascriptjsoncsharpbusinesstools
2 Posts 2 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manishchourasia2000
    wrote on last edited by
    #1

    Hi Friends, I am new user for jQuery and jqGrid. I am trying to implement jqGrid with client side pagination. It is not working at my end. I am using .net 4.0 web service to get json respons. This is my web service code

    public string GetMessage(string FDate,string TDate,string Status)
    {
    databaseDataContext dc = new databaseDataContext();
    var v = (from v1 in dc.WBS_MESSAGEs
    where v1.TransStatus == Status && v1.CreatedDate >= fromDate
    && v1.CreatedDate <= toDate
    select new
    {
    v1.MessageID,
    v1.Task,
    v1.Remark,
    v1.CreatedDate,
    Object = (v1.ObjectID == "2" ? "Business Partner" :
    v1.ObjectID == "30" ? "Journals" : "Unknown")
    });
    if (v.Count() > 0)
    {

                System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
                return js.Serialize(v.ToList());
            }
            else
            {
                return null;
            }
    }
    

    This is my JavaScript / jqGrid code function callMessage(p0, p1,p2,ctrlName) { $.ajax({ type: "POST", url: "SAPBOne.asmx/GetMessage", data: '{ "FDate":"' + p0 + '" ,"TDate":"' + p1 + '","Status":"' + p2 + '"}', contentType: "application/json; charset=utf-8", dataType: "json", error: function (data) { alert(data.statusText); }, success: function (data) { var thegrid = jQuery(ctrlName)[0]; thegrid.addJSONData(JSON.parse(data.d)); // var jSonMessage = JSON.parse(data.d); // data.d is a JSON formatted string, to turn it into a JSON object // we use JSON.parse // now that myData is a JSON object we can access its properties like normal } }); }; $(window).load(function () { var qString = get_qu

    A 1 Reply Last reply
    0
    • M manishchourasia2000

      Hi Friends, I am new user for jQuery and jqGrid. I am trying to implement jqGrid with client side pagination. It is not working at my end. I am using .net 4.0 web service to get json respons. This is my web service code

      public string GetMessage(string FDate,string TDate,string Status)
      {
      databaseDataContext dc = new databaseDataContext();
      var v = (from v1 in dc.WBS_MESSAGEs
      where v1.TransStatus == Status && v1.CreatedDate >= fromDate
      && v1.CreatedDate <= toDate
      select new
      {
      v1.MessageID,
      v1.Task,
      v1.Remark,
      v1.CreatedDate,
      Object = (v1.ObjectID == "2" ? "Business Partner" :
      v1.ObjectID == "30" ? "Journals" : "Unknown")
      });
      if (v.Count() > 0)
      {

                  System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
                  return js.Serialize(v.ToList());
              }
              else
              {
                  return null;
              }
      }
      

      This is my JavaScript / jqGrid code function callMessage(p0, p1,p2,ctrlName) { $.ajax({ type: "POST", url: "SAPBOne.asmx/GetMessage", data: '{ "FDate":"' + p0 + '" ,"TDate":"' + p1 + '","Status":"' + p2 + '"}', contentType: "application/json; charset=utf-8", dataType: "json", error: function (data) { alert(data.statusText); }, success: function (data) { var thegrid = jQuery(ctrlName)[0]; thegrid.addJSONData(JSON.parse(data.d)); // var jSonMessage = JSON.parse(data.d); // data.d is a JSON formatted string, to turn it into a JSON object // we use JSON.parse // now that myData is a JSON object we can access its properties like normal } }); }; $(window).load(function () { var qString = get_qu

      A Offline
      A Offline
      Artefakt94
      wrote on last edited by
      #2

      Here is a good thread about this topic ;) http://stackoverflow.com/questions/3197065/jqgrid-on-clientside-paging-editing-sorting-queries[^]

      Light or darkness, we must choose ...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups