0

こんにちは私のJSONは:(読みやすくするためにフォーマットされています)

{"status":{"status":0,"msg":"Ok","protocolversion":"extjs.json"},
"list":[{"getLogfiles":[
{"key":"0","value":"...lugin\/monitor\/files\/x_worker_error.log"},
{"key":"1","value":"...les\/x-worker01-progress.log.1331769600"},
{"key":"2","value":"...\/application\/x\/plugin\/monitor\/files\/Test.log"},
{"key":"3","value":"...ind\/plugin\/monitor\/files\/logfile_for_navi_test.log"},
{"key":"4","value":"...lugin\/monitor\/files\/logfilefilter_worker_error.log"}]
}]
}

このjsonデータは正常に読み込まれ、console.log()に出力できますが、ストアに読み込まれません。

    ...
   Ext.define( 'Xxx.plugins.monitor.store.GridLogfiles', {
      extend  : 'Ext.data.Store',
      mixins: [ 
         'Deft.mixin.Injectable'
      ],

      model: 'Xxx.plugins.monitor.model.GridLogfiles',

      proxy   : {
         type       : 'ajax',
         url        : 'xxx',
         extraParams: {
            user      : 'test',
            pass      : 'test',
            vers      : 'extjs.json',
            module    : 'monitor',
            func      : 'getLogfiles'
         },
         reader     : {
            type: 'json',
            root: 'list[0].getLogfiles',
            // root: 'list',
            successProperty:false
         } 
      }
     , autoLoad: true


   } );
...

私は両方を試しましroot: 'list'root: 'list[0].getLogfiles

console.log()データは下にありますrawData (obj) -> list (array) -> 0 -> getLogfiles (array) -> 0, 1, 2 -> key, value

なにが問題ですか?ありがとう!

4

1 に答える 1

0

だから私はそれを修正します:

root: 'list'

Jsonを次のように変更します。

{"status":{"status":0,"msg":"Ok","protocolversion":"extjs.json"},"list":[{"key":"0","value":"...lugin\/monitor\/files\/logfilefilter_worker_error.log"},{"key":"1","value":"...les\/logfilefilter-worker01-progress.log.1331769600"},{"key":"2","value":"...\/application\/x\/plugin\/monitor\/files\/Test.log"},{"key":"3","value":"...ind\/plugin\/monitor\/files\/logfile_for_navi_test.log"},{"key":"4","value":"...lugin\/monitor\/files\/logfilefilter_worker_error.log"},{"key":"5","value":"...les\/logfilefilter-worker01-progress.log.1331769600"},{"key":"6","value":"...\/application\/x\/plugin\/monitor\/files\/Test.log"},{"key":"7","value":"...lugin\/monitor\/files\/logfilefilter_worker_error.log"},{"key":"8","value":"...les\/logfilefilter-worker01-progress.log.1331769600"},{"key":"9","value":"...\/application\/x\/plugin\/monitor\/files\/Test.log"}]}

Ext.create()DeftJの代わりに使用しますinject: {}

助けてくれてありがとう。

于 2012-05-30T15:01:05.123 に答える