jQuery jqGrid文档

I am trying to learn the jQuery jqGrid and I must say, the docs are very sparse...

I went to the following link, but this is not helping much at all. http://www.trirand.com/blog/jqgrid/jqgrid.html

There must be some links out there (I've searched the web, but can't find any valid ones) that are conducive to loading and editing a grid for a .Net C# developer using Web Forms and Ajax.

I need to get the data via an Ajax call via a "stringify" on a DTO object (which I know how to do), then I need to serialize a that object back and pass it to the jqGrid. Before doing this last part, I believe I need to do some SQL Server manipulation as far as the number of rows to display, total number of rows, etc. which has me confused as well. I don't suppose that the jqGrid can handle this on its own like some of the 3rd party controls can...

I know how to serialize the json to a .Net object using Json.Net. The part that's giving me trouble is really all the setup involved with the actual loading of the data into the grid. Once there, then all the methods and events for editing and saving a row, etc.

Can somebody point me to some very good examples and or links?

After speaking to some other developers, they suggested to use the GridView client side grid instead of the jqGrid which is just not quite up to snuff as the GridView grid is. They informed me that the GridView is more powerful, yet easier to use than the jqGrid.

Yes you are correct you need to do SQL/data operations before you pass that data back to jqgrid as json or XML, if you need server side pagination.

Along with your json data in the root you should also send back the following properties:

  • total - total pages for the query
  • page - current page of the query (This will be returned back to the server from the client as well, when you click on the next button)
  • records - total number of records for the query
  • rows - an array that contains the actual data

The above values can also be controlled using the jsonreader property when you pass as grid params:

jsonReader : {
      root:"invdata",
      page: "currpage",
      total: "totalpages",
      records: "totalrecords"
      ....

A sample JSON response would be:

{ 
  "total": "10", 
  "page": "2", 
  "records": "100",
  "users" : [
    {"id" :"1", "cell" :["cell11", "cell12", "cell13"]},
    {"id" :"2", "cell":["cell21", "cell22", "cell23"]},
      ...
  ]
}

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data