$('#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' }
]
});上面是我的js代码。
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);
}
上面是我的后台取数据代码,是asp.net的一般处理程序,返回的数据是json字符串,如下:[{"productId":1,"productName":"ipad","specification":"黑色 8G","merchantCode":"Y001201","sellingStore":"淘宝一电(80)","priceRange":"4000~5000","repertory":80,"updateTime":"2013-06-21T17:06:39.547"},
{"productId":2,"productName":"iphone","specification":"黑色 8G","merchantCode":"Y101201","sellingStore":"拍拍一店(60)","priceRange":"3500~4000","repertory":80,"updateTime":"2013-06-21T17:07:46.913"},
{"productId":3,"productName":"ipad","specification":"黑色 8G","merchantCode":"Y001201","sellingStore":"淘宝一电(80)","priceRange":"4000~5000","repertory":80,"updateTime":"2013-06-21T17:06:39.547"}]我的问题是为什么前台不显示我的数据内容:
只有一个表头,是不是我的数据格式不对?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' }
]
});上面是我的js代码。
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);
}
上面是我的后台取数据代码,是asp.net的一般处理程序,返回的数据是json字符串,如下:[{"productId":1,"productName":"ipad","specification":"黑色 8G","merchantCode":"Y001201","sellingStore":"淘宝一电(80)","priceRange":"4000~5000","repertory":80,"updateTime":"2013-06-21T17:06:39.547"},
{"productId":2,"productName":"iphone","specification":"黑色 8G","merchantCode":"Y101201","sellingStore":"拍拍一店(60)","priceRange":"3500~4000","repertory":80,"updateTime":"2013-06-21T17:07:46.913"},
{"productId":3,"productName":"ipad","specification":"黑色 8G","merchantCode":"Y001201","sellingStore":"淘宝一电(80)","priceRange":"4000~5000","repertory":80,"updateTime":"2013-06-21T17:06:39.547"}]我的问题是为什么前台不显示我的数据内容:
只有一个表头,是不是我的数据格式不对?flexigrid
解决方案 »
- 两个JS文件冲突了,求教大神!!
- 关于这个图片滚动,我遇到了问题了
- 如何取消表单的记录
- 怎么用javascript制作一个5*5的表格,每当界面刷新,25个数字都会随机添加到这25个格子里???
- JS如何得到Get的传值
- 请问下 动态生成的checkbox选中的时候,怎么有值是undefined?
- 怎么判断浏览器的版本是 IE 6 及以上?
- 点击连接,强制下载,html也不例外,怎么实现??
- 想实现鼠标指针放在表格的数字上就能出现一个金山词霸那样的小窗口,鼠标移开窗口就消失,请大家帮忙,下面给出源代码
- 如何让网页不存放在客户端的缓冲区!
- html中能同时嵌入两个瀑布流样式吗?
- 关于建网站的一些问题,请高人指点一下!
sbu.Append("{\"pid\":" + item.productId + ",\"cell\":[\"" + item.productId + "\",\"" + item.productName + "\",\"" + item.specification + "\",\"" + item.merchantCode + "\",\"" + item.sellingStore + "\"");
sbu.Append(",\"" + item.priceRange + "\",\"" + item.repertory + "\",\"" + item.updateTime + "\"]},");
现在有一个新问题,就是我的数据在FF chrome oprea 360等浏览器正常显示数据,但是IE的各个版本都不显示
FF chrome oprea 360等浏览器:
在IE下:
有知道处理方法的朋友吗?谢谢