Loading data into model by id-Extjs

im trying to use direct store in Extjs heres the code to my store

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'
})

the code for model is

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'
})

as you can see the idProperty is Path the following code segment is giving error

//this.getStore('IDE.store.Files').load(path, { sucess: function (file) {
//                console.log(file.get('Content'));           
//            } });
this.getStore('IDE.store.Files').load(path);

here im getting path from somewhere and trying to load a file from the particular path the error is

 Ext.data.proxy.Direct.doRequest(): No direct function specified for this proxy

now the problem is that documentation of extjs isnt enough and everywhere i searched i could only see 4 api in the api object of proxy. Which are 1.create 2.read 3.update 4.destroy which api am i missing ? OR where do i need to give a direct function for load()

Answers


there are multiple problems that i could figure out with my code so just putting here for help of community. 1. the way i was calling the load function is correct.. and it just doest takes the parameter but a whole object with scope and callback so mayb that was the error saying http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Store-method-load 2. if i just remove the api.. and use the directFn config option then it appears to work..

Code:

Ext.define('IDE.store.Files', {
    extend: 'Ext.data.Store',
    proxy: {
        type: 'direct',
        directFn: Files.GetFile, // <--- new line of code
        api: {
            create:Files.AddNew,
            //read:Files.GetFile, // <--- old line of code
            update:Files.Update,
            destroy:Files.Delete
        },
        paramOrder:'Path'
    },
    model:'IDE.model.File'
})

Need Your Help

Typeahead Bloodhound Rails with pg_search

javascript ruby-on-rails typeahead.js twitter-typeahead bloodhound

I am using this stackoverflow answer to try and implement Twitter Typeahead for my rails app and I have also tried implementing the Github readme but there is no text suggestions when I type into the