我有一個JqGrid,我需要發送約10Mb的數據作爲json填充網格。我發送JSON作爲這樣的內容結果:向客戶端網格發送價值10MB的數據的最佳方式是什麼?
public ContentResult GetDynamicColumnData(int? fieldListId)
{
var serializer = new JavaScriptSerializer();
serializer.MaxJsonLength = Int32.MaxValue;
IList<FieldListView> fieldListValues = null;
if (fieldListId != null)
{
fieldListValues = fieldListService.GetFieldListValues(fieldListId.Value);
}
var resultData = new { fieldListValues };
var result = new ContentResult
{
Content = serializer.Serialize(resultData),
ContentType = "application/json"
};
return result;
}
列表稱爲fieldListvalues有大約50000對象。 問題是我的Jqgrid需要大約3分鐘才能加載到Chrome中,並且根本不會加載到Firefox中。
那麼最好的方式是將大量數據發送到客戶端並將其呈現在網格中。
認真嗎? 10MB?然後[我以前的答案](http://stackoverflow.com/a/10371912/575527)我可以幫助,但仍然是10MB? – Joseph
用[DataTables](http://datatables.net/)替換jqGrid - >支持服務器端處理 - 因此它只能檢索用戶可見的數據... – ManseUK
jqGrid支持服務器端分頁 - http:// www。 trirand.net/demoaspnetmvc.aspx使用這個方法 – ManseUK