87,992
社区成员
发帖
与我相关
我的任务
分享 $('#flexigridtable').flexigrid({
url: 'GetFlexigridData.ashx',
dataType: 'json',
colModel : [
{ display: 'productId', name: 'productId', width: 60, sortable: true, align: 'center' },
{ display: 'productlistName', name: 'productName', width: 60, sortable: true, align: 'center' },
{ display: 'specification', name: 'specification', width: 140, sortable: true, align: 'left' },
{ display: 'merchantCode', name: 'merchantCode', width: 120, sortable: true, align: 'left' },
{ display: 'sellingStore', name: 'sellingStore', width: 130, sortable: true, align: 'left', hide: false },
{ display: 'priceRange', name: 'priceRange', width: 80, sortable: true, align: 'right' },
{ display: 'repertory', name: 'repertory', width: 80, sortable: true, align: 'right' },
{ display: 'updateTime', name: 'updateTime', width: 80, sortable: true, align: 'right' }
]
}); public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
DataModelDataContext db = new DataModelDataContext();
List<Products> list = db.Products.ToList();
string jsonStr = JsonConvert.SerializeObject(list);
context.Response.Write(jsonStr);
}

sbu.Append("{\"pid\":" + item.productId + ",\"cell\":[\"" + item.productId + "\",\"" + item.productName + "\",\"" + item.specification + "\",\"" + item.merchantCode + "\",\"" + item.sellingStore + "\"");
sbu.Append(",\"" + item.priceRange + "\",\"" + item.repertory + "\",\"" + item.updateTime + "\"]},");
