y393791327
y393791327
2015-07-16 02:30
采纳率: 38.3%
浏览 7.8k

extjs 报错You're trying to decode and invalid JSON

IE报错:You're trying to decode and invalid JSON String: {"ganttTask":{"baseline_end_date":null,"baseline_start_date":null,"duration":0.0,"duration_unit":null,"end_date":null,"id":4,"index":3,"name":"New Task","other_field":null,"parent_id":null,"percent_done":100,"pid":7,"priority":null,"start_date":null,"task_id":"JMPAR000007"},"ganttTaskList":[{"baseline_end_date":null,"baseline_start_date":null,"duration":0.0,"duration_unit":null,"end_date":"2015-07-23","id":1,"index":1,"name":"New Task","other_field":","parent_id":null,"percent_done":100,"pid":7,"priority":null,"start_date":"2015-07-02","task_id":"JMPAR000007"},{"baseline_end_date":null,"baseline_start_date":null,"duration":0.0,"duration_unit":null,"end_date":null,"id":2,"index":4,"name":"New Task","other_field":null,"parent_id":null,"percent_done":0,"pid":7,"priority":null,"start_date":null,"task_id":"JMPAR000007"},{"baseline_end_date":null,"baseline_start_date":null,"duration":0.0,"duration_unit":null,"end_date":"2015-07-29","id":3,"index":2,"name":"New Task","other_field":null,"parent_id":null,"percent_done":0,"pid":7,"priority":null,"start_date":"2015-07-01","task_id":"JMPAR000007"},{"baseline_end_date":null,"baseline_start_date":null,"duration":0.0,"duration_unit":null,"end_date":null,"id":4,"index":3,"name":"New Task","other_field":null,"parent_id":null,"percent_done":100,"pid":7,"priority":null,"start_date":null,"task_id":"JMPAR000007"}],"signTask":null,"success":true,"taskCount":0,"taskList":null,"task_id":"JMPAR000007"}

如果date里有日期它就不报错。为什么?

 Ext.define('GanttTask', {
            extend: 'Ext.data.Model',
            fields: [
                   {name: 'task_id',       type: 'string'},
                   {name: 'name',       type: 'string'},
                   {name: 'percent_done',       type: 'int'},
                   {name: 'start_date',       type: 'string'},
                   {name: 'end_date',       type: 'string'},
                   {name: 'other_field',       type: 'string'},
                   {name: 'duration',       type: 'string'},
                   {name: 'pid',       type: 'int'},
                   {name: 'index',       type: 'int'}
                ]
        });

     var adstore = Ext.create('Ext.data.Store', {
            remoteSort: true,
            //设置分页大小  
            remoteFilter : true,     
            model: 'GanttTask',
            proxy: {             
                type: 'ajax',
                url: 'taskList_query.action?task_id='+task_id, 
                reader: {
                    type: 'json',
                    root: 'ganttTaskList',
                        //获取数据总数  
                    totalProperty: 'totalCount'
                }
           },
            autoLoad: false
        }

        );
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

5条回答 默认 最新

  • danielinbiti
    danielinbiti 2015-07-16 02:41
    已采纳
     "name":"New Task","other_field":","parent_id":null,
     看看"other_field":",",这个json格式不对了
     可以上在线网站校验
     http://www.bejson.com/
    
    点赞 评论
  • bdmh
    bdmh 2015-07-16 02:42

    就是你的json格式不对导致的,你可以用一些json的解析工具,检测一下你的json格式

    点赞 评论
  • u012216727
    大河行脚 2015-07-16 02:43

    你的json格式有问题导致的,网上有json解析工具你可以试试

    点赞 评论
  • u012402524
    vonions 2015-07-16 03:18

    很明显json格式不正确

    点赞 评论
  • CSDNXIAOC
    Robot-C 2015-07-16 07:33

    就是in session检测失败了,重新录一下登录脚本

    scan-configruation-login -record
    用户登陆

    ......
    答案就在这里:Rational AppScan Standard has detected it is out-of-session and is trying to re-login
    ----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

    点赞 评论

相关推荐