私のJsonデータ:-
{
"attributes": {
"list": [
{
"name":"attribute2",
"value":"attribute2 value"
}, {
"name":"attribute1",
"value":"attribute1 value"
}]
}
"name":"name1",
"id":1234
}
私の店の定義:-
Ext.define('Attr', {
extend: 'Ext.data.Store',
model: 'Attribute',
autoLoad: true,
proxy: {
type: 'rest',
url: 'data/1234',
api: {
update: 'newdata/1234'
},
reader: {
type: 'json',
root: 'attributes.list'
}
}
});
私のモデル定義:-
Ext.define('Attribute', {
extend: 'Ext.data.Model',
fields: ['name','value']
});
上記のストアを表示するためのビュー:-
{
xtype: 'grid',
store: 'Attr',
id: 'attrpanel',
columns: [
{
header: 'Name',
sortable: true,
dataIndex: ['name'],
flex: 1
}, {
header: 'Value',
sortable: true,
dataIndex: ['value'],
flex: 1
}]
}
現在の状況: Json オブジェクトからデータ値を表示できます。
問題: フィールドを編集した後、コントローラーで this.getAttrStore().sync() を呼び出すたびに、エラーが発生します。多数のフォーラムを検索したところ、深くネストされた JSON データの更新中に問題があるように思われることに気付きました。
Peter Muller のパッチを入手することを考えましたが、実際には試していません。
私が間違っている場合は修正してください。または、何か役立つものを教えていただければ、大きな助けになります。
どうもありがとう!