日期:2014-05-16 浏览次数:20514 次
$('#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);
}