Extjs 页面
var reader = new Ext.data.JsonReader({
//             totalProperty:"totalCount",//分页使用
            root : 'data',
autoLoad : true,
fields : [{
name : 'newsid'
}, {
name : 'newsclassify'
}, {
name : 'newstitle'
}, {
name : 'newscontent'
}, {
name : 'newstime'
}, {
name : 'newsowner'
}, {
name : 'newsdesc'
} ] }); var ds = new Ext.data.GroupingStore({
scopte : this,
url : '/newsinfo.mvc/FindAllByPage_newsinfo',
reader : reader,
sortInfo : {
field : 'newsclassify',
direction : "DESC"
}, groupField : 'newsclassify',
groupByText : '按此字段分组',
showGroupsText : '在分组中显示'

});
controller
public string  FindAllByPage_newsinfo(string start, string limit)
        {
            IList list = ManagerFactory.newsinfoMgr.FindAllByPage_newsinfo(start, limit);
            string json = JSONHelper.ToJson<newsInfo>("data", list);
            //json已经是json格式的了:{"data":[{...},{...}]}
            return  json;
        }为什么前台接受不了json数据,是我写错了,还是什么原因???

解决方案 »

  1.   

    显示不出来可能是你显示的问题,不一定是没返回值,你可以用fiddler或其它http捕获工具测试一下看返回什么了
      

  2.   

    试过了,还是不行啊,不知道什么原因,无从下手啊public ActionResult FindAllByPage_newsinfo(string start, string limit)
            {
                IList list = ManagerFactory.newsinfoMgr.FindAllByPage_newsinfo(start, limit);
                string json = JSONHelper.ToJson<newsInfo>("data", list);
                json = json.Replace("\"data\"", "\"totalCount\":4,\"data\"");
                Response.Write(test);
                return this.Content(test);
            }还有没人会的?
    在顶顶!!!
      

  3.   

    上面错了 ,是return this.Content(json),不是test