Best way to optimize my json on asp.net-mvc

I am currently using jqgrid on asp.net mvc and we have a rather slow network (internal application) and it seems to load the grid for a long time (the problem is both in the network and in parsing, rendering)

I am trying to determine how to minimize what I send to the client in order to make it as fast as possible.

The following is a simplified view of my controller action for loading data into a grid:

     [AcceptVerbs(HttpVerbs.Get)]
     public ActionResult GridData1(GridData args)
     {
        var paginatedData = applications.GridPaginate(args.page ?? 1, args.rows ?? 10,
        i => new
           {
       i.Id,
       Name = "<div class='showDescription' id= '" + i.id+ "'>" + i.Name + "</div>",
       MyValue = GetImageUrl(_map, i.value, "star"),
       ExternalId = string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>",
       Url.Action("Link", "Order", new { id = i.id }), i.Id),
              i.Target,
              i.Owner,
              EndDate = i.EndDate,
              Updated = "<div class='showView' aitId= '" + i.AitId + "'>" + GetImage(i.EndDateColumn, "star") + "</div>",
                                                      })

        return Json(paginatedData);
     }

So, I collect json data (I have about 200 entries above) and send it back to the GUI to insert jqgrid.

, , . json- HTML "". HTML . , , "" HTML . ? HTML (divs ..).

, - , , . , - , .

+3
3

Craig Stuntz: HTTP- . .

, HTML jqGrid. jqGrid (. http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter jqGrid: , ), <TD> jqGrid. , html- jqGrid , . html . , - jqGrid html.

, "" "" . , , "Bla Bla Bla" "Ha Ha Ha" , 0 "Bla Bla Bla" 1 "Ha Ha Ha" . 0 1 "Bla Bla Bla" "Ha Ha Ha" . , , (jsonReader) .

: jsonReader (. http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#jsonreader_as_function jquery ASP.NET MVC - - ajax) jsonmap (. JSON JQGrid ), . , JSON, , jqGrid ( colModel), , jsonReader jsonmap .

. , :

Name = "<div class='showDescription' id= '" + i.id+ "'>" + i.Name + "</div>",

jqGrid id (<tr>), <div> cell (<TD>, <tr> ). . HTML .

. , :

, , . , :

.

2: JSON, Jqgrid 3.7 Internet Explorer p >

+8

ZIP. .

+1

, html , jqgrid Formatter:

http://www.secondpersonplural.ca/jqgriddocs/_2kn0mlo1p.htm

-

Also, although I assume there is a reason for returning 200+ entries per page, is a paginated page an option?

+1
source

All Articles