Hi,
I am developing an app to display directory structure of a server on a mobile platform.
I have to make two REST proxy calls in a single event 'show' of the list view.
The 1st call is to get the ID of the base folder. Using this ID, I make a call to retrieve its
sub folders.
The 1st call I make during the show event of the list view goes like this:
Code:
var resolveStore = Ext.getStore("idResolveStore");
resolveStore.setProxy({
type: 'rest',
url: '/Document_Management_App/application?path=%2FProjects',
reader: {
type: 'json'
}});
resolveStore.data.clear();
resolveStore.load();
var rec = resolveStore.findRecord("object_name", "Projects");
The findRecord call always returns null. But I am able to see the record in the server response tab in the browser.
Using this record i need to make another REST call.
Am I doing something wrong here? Why am I unable to retrieve the record from the store ?
AFAIK a model instance need not be set explicitly to a store when you do a load().
Btw the model which is set to the store is given below:
Code:
Ext.define('MyApp.model.ResolveModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'r_lock_owner',
type: 'string'
},
{
name: 'object_name',
type: 'string'
},
{
name: 'r_creator_name',
type: 'string'
},
{
name: 'r_creation_date',
type: 'string'
},
{
name: 'r_modifier',
type: 'string'
},
{
name: 'r_modify_date',
type: 'string'
},
{
name: 'owner_name',
type: 'string'
}
]
}
});
Any help would be greatly appreciated.
Thanks !