Extjsで直接ストアを使用しようとして
います私のストアへのコードはこちら
Ext.define('IDE.store.Files', {
extend: 'Ext.data.Store',
proxy: {
type: 'direct',
api: {
create:Files.AddNew,
read:Files.GetFile,
update:Files.Update,
destroy:Files.Delete,
//load:Files.GetFile
},
paramOrder:'Path'
},
model:'IDE.model.File'
})
モデルのコードは
Ext.define('IDE.model.File', {
extend: 'Ext.data.Model',
fields: [
{ name: 'Path', type: 'string' },
{ name: 'Name', type: 'string' },
{ name: 'Extention', type: 'string' },
{ name: 'Content', type: 'string' }
],
idProperty:'Path',
store:'IDE.store.Files'
})
ご覧のidProperty
とおりPath
、次のコードセグメントでエラーが発生しています
//this.getStore('IDE.store.Files').load(path, { sucess: function (file) {
// console.log(file.get('Content'));
// } });
this.getStore('IDE.store.Files').load(path);
ここでpath
、どこかから取得して、特定のパスからファイルをロードしようとすると、エラーが発生します
Ext.data.proxy.Direct.doRequest(): No direct function specified for this proxy
今の問題は、extjs のドキュメントが十分ではなく、どこを検索しても のapi
オブジェクトに 4 つの API しか表示されないことですproxy
。
1.create
2.read
3.update
4.destroy のうち、不足している API はどれ
ですか? または
、どこに直接関数を与える必要がありますかload()