I'm trying to load nested JSONData into my tree grid. On the first call to get data, all the data needed to populate the grid is returned in the response as a JSON Object. However I can see that it still tries fetch data for all the parent objects in the grid.
Even after the spurious GETs, it is still unable to populate the child Nodes.
I've defined 2 models, the parent with a "hasMany" relationship referring to the child model, and the child node with "BelongsTo" relationship referring to the parent model
I'm using an Ajax Proxy with a JSON reader.
Searching the web I can't find much information and I've used the user-orderitems-products example in the extJS documentation to try and set up the my models and tree.
I'm not entirely sure what I'm missing. Any assistance would be much appreciated.
JSON (person may or may not have children objects):
People: {
{firstName: john, id:123, uniqueID:1231, leaf:true},
{firstName: jane, id:124, uniqueID:1240,
offspring:[
{firstName: adam, id:124, uniqueID:1241, leaf:true},
{firstName: brandon, id:124, uniqueID:1242, leaf:true},
{firstName: claire, id:1243, uniqueID:1243, leaf:true}
]}
}
Model:
Ext.define('Person',{
extend: 'Ext.data.Model',
fields: [
{name: 'firstName', type:'string'},
{name: 'uniqueID', type:'float'}
hasMany: {
model:'Offspring',
name: 'Offspring',
associationKey: 'offspring',
primaryKey: 'uniqueID',
foreignKey: 'id'
}
],
proxy: {
type: 'rest',
url: 'http://blah/blah',
reader: {
type: 'json',
root: 'People'
}
}
});
Ext.define('Offspring',{
extend: 'Ext.data.Model',
fields: [
{name: 'firstName', type:'string'},
{name: 'uniqueID', type:'float'}
],
belongsTo: 'Person'
});
Store Definition:
var store = Ext.create('Ext.data.TreeStore', {
model: 'Person',
folderSort: true
}
I suspect you might be confusing a simple parent-child relationship with hasMany relationship.
But for your original question. You are returning a node (jane) which is not a leaf, but has no children returned. As your proxy root for Person is People, the children property should also be people.
I believe the following JSON will work for you:
People: {
{firstName: john, id:123, uniqueID:1231, leaf:true},
{firstName: jane, id:124, uniqueID:1240,
People:[
{firstName: adam, id:124, uniqueID:1241, leaf:true},
{firstName: brandon, id:124, uniqueID:1242, leaf:true},
{firstName: claire, id:1243, uniqueID:1243, leaf:true}
]}
}
Here is a working code:
Model:
Ext.define('BS.model.ItemCategory', {
extend: 'Ext.data.Model',
fields: [
{name: 'name' , type: 'string'},
{name: 'iconCls' , type: 'string', defaultValue: 'treenode-no-icon'},
{name: 'leaf' , type: 'boolean', defaultValue: false},
{name: 'expanded' , type: 'boolean', defaultValue: true, persist: false},
{name: 'index' , type: 'int'},
],
proxy: {
type: 'direct',
api: {
create: ItemCategories.Create,
read: ItemCategories.Read,
update: ItemCategories.Update,
destroy: ItemCategories.Destroy,
},
},
});
Store:
Ext.define('BS.store.ItemCategories', {
extend: 'Ext.data.TreeStore',
model: 'BS.model.ItemCategory',
autoSync: true,
root: {
text: 'Root',
id: 'NULL',
expanded: true
},
clearOnLoad: true,
});
JSON:
"result":{
"success":true,
"children":[
{
"id":"1",
"parentId":null,
"name":"DFM",
"index":"0",
"deleted":"0",
"children":[
{
"id":"6",
"parentId":"1",
"name":"Studios",
"index":"0",
"deleted":"0",
"loaded":true,
"leaf":false
},
{
"id":"7",
"parentId":"1",
"name":"Equipment",
"index":"1",
"deleted":"0",
"children":[
{
"id":"18",
"parentId":"7",
"name":"Cameras",
"index":"0",
"deleted":"0",
"loaded":true,
"leaf":false
},
{
"id":"20",
"parentId":"7",
"name":"Tripods",
"index":"1",
"deleted":"0",
"loaded":true,
"leaf":false
},
{
"id":"26",
"parentId":"7",
"name":"Lighting Kits",
"index":"2",
"deleted":"0",
"loaded":true,
"leaf":false
}
],
"leaf":false
}
],
"leaf":false
},
{
"id":"3",
"parentId":null,
"name":"3D",
"index":"2",
"deleted":"0",
"loaded":true,
"leaf":false
}
]
}
There's an example of exactly this in the SDK download: http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/tree/treegrid.html
Related
I'm going through a sencha tutorial and I'm receiving this error when attempting to implement a store in my app. I'm sure this is something simple I'm overlooking but I'm having trouble figuring out what it is.
applyStore] The specified Store cannot be found
Here is the relevant code:
//from app.js
stores: [
'MyStore'
],
//from the view
Ext.define('listerApp2.view.Main', {
extend: 'Ext.dataview.List',
xtype: 'main',
requires: [
'Ext.TitleBar',
'listerApp2.store.MyStore'
],
config: {
title: 'My listing',
store: 'MyStore'
}
});
//from the store
Ext.define('listerApp2.store.MyStore', {
requires: ['listerApp2.model.MyModel'],
config: {
autoload: true,
model: 'MyModel',
storeId: 'MyStore',
alias: 'store.MyStore',
data: [
{firstName: 'Washington', lastName: 'George', age: 250},
{firstName: 'Lincoln', lastName: 'Abe', age: 200},
{firstName: 'Clinton', lastName: 'Bill', age: 60}
],
proxy: {
type: 'localStorage'
}
}
});
//and the model
Ext.define('listerApp2.model.MyModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' },
{ name: 'age', type: 'int' }
]
}
});
You have mixed up many things in your code. For e.g. you have used localStorage and storeId which are not making any sense here. I have simplified your code and pasting here:
Model
Ext.define('MyApp.model.DataModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' },
{ name: 'age', type: 'int' }
]
}
});
Store
Ext.define('MyApp.store.DataStore', {
extend: 'Ext.data.Store',
config: {
model: 'MyApp.model.DataModel',
autoLoad: true,
data: [
{firstName: 'Washington', lastName: 'George', age: 250},
{firstName: 'Lincoln', lastName: 'Abe', age: 200},
{firstName: 'Clinton', lastName: 'Bill', age: 60}
]
}
});
View
Ext.define('MyApp.view.HobbyList', {
extend: 'Ext.List',
xtype: 'hobbyList',
requires: [
'Ext.dataview.List'
],
config: {
styleHtmlContent : true,
itemTpl : new Ext.XTemplate(
'{firstName} {lastName} is {age} years old.'
),
store: 'DataStore'
}
});
I have tested this. It is working fine. Take a look.
Happy Coding!
I have the following JSON structure:
userAuth
----userAccount -- hasOne
----userAccountDetails -- hasMany
I want to show a form that shows data from userAuth and userAccount and then a grid with a row for each row in userAccountDetails
Here is the code for userAuth model:
Ext.define('xxxx.model.UserAuth', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id' },
{ name: 'email' },
{ name: 'userName' },
{ name: 'refIdStr' },
{ name: 'displayName' },
{ name: 'modifiedDate', type: 'date', }
],
requires: [
'xxxx.model.UserAccount',
'xxxx.model.UserAuthDetails',
],
hasMany: [
{
model: 'xxxx.model.UserAuthDetails',
name: 'authDetails',
foreignKey: 'userAuthId',
associationKey: 'userAuthDetails',
}
],
hasOne: [
{
model: 'xxxx.model.UserAccount',
name: 'userAcount',
associationKey: 'userAccount',
getterName: 'getUserAccount',
setterName: 'setUserAccount',
}
],
proxy: {
type: 'ajax',
startParam: 'skip',
limitParam: 'take',
url: settings.ApiUrl + '/model/UserAuth/?format=json',
baseParams: {
skip: '0',
take: '10',
},
reader: {
type: 'json',
root: 'results',
successProperty: 'success',
totalProperty: 'totalCount'
}
}
});
And userAccount model
Ext.define('xxxx.model.UserAccount', {
extend: 'Ext.data.Model',
fields: [
{ name: 'username' },
{ name: 'id' },
{ name: 'name' },
{ name: 'email' },
{ name: 'slug' },
{ name: 'facebookId' }
],
belongsTo: 'xxxx.model.UserAuth',
proxy: {
type: 'ajax',
startParam: 'skip',
limitParam: 'take',
url: settings.ApiUrl + '/model/UserAccount/?format=json',
baseParams: {
skip: '0',
take: '10',
},
reader: {
type: 'json',
root: 'results',
successProperty: 'success',
totalProperty: 'totalCount'
}
}
});
and userAuthDetails:
Ext.define('xxxx.model.UserAuthDetails', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id' },
{ name: 'userAuthId' },
{ name: 'provider' },
{ name: 'userId' },
{ name: 'userName' },
{ name: 'displayName' },
{ name: 'firstName' },
{ name: 'lastName' },
{ name: 'email' },
{ name: 'modifiedDate' },
{ name: 'provider' },
],
belongsTo: [
{
model: 'xxxx.model.UserAuth',
isntanceName: 'userAuth',
getterName: 'getUserAuthDetails',
setterName: 'setUserAuthDetails',
associationKey: 'userAuthDetails'
}
],
proxy: {
type: 'ajax',
startParam: 'skip',
limitParam: 'take',
url: settings.ApiUrl + '/model/UserAuthDetails/?format=json',
baseParams: {
skip: '0',
take: '10',
},
reader: {
type: 'json',
root: 'results',
successProperty: 'success',
totalProperty: 'totalCount'
}
}
});
Loading the store works and the associations work - when i call record.getUserAccount().get('email') it returns what I'd expect - so all that is working.
Now, my question is - how the hell do i get that data into the form described above?
I have tried doing things like:
{
xtype: 'textfield',
fieldLabel: 'username',
allowBlank: false,
maxLength: 100,
name: 'userAccount.userName'
}
thinking the association name might be a good hint for it - but that doesn't work...
Data from the top most model (userAuth) works ok - I just can't seem to pull in the hasOne
into the form.
I haven't even tried binding the userAuthDetails to a grid yet but suspect that will be equally as challenging
Has anyone managed to get this to work? I only went down the associations route because i thought it would make this sort of stuff cleaner / simpler!
[EDIT]
Giving up trying to do this with a form as I am happy for this data to be read only for now. I am now trying to show this data in an xtemplate within a row expander.
I've tried the following but it does not work!!!
plugins: [
{
ptype: 'rowexpander',
rowBodyTpl: [
'<p><b>Username:</b> {userName}</p>',
'<p><b>Email:</b> {userAccount.email}</p>',
'<tpl for="userAuthDetails">',
'<p>{provider}</p>',
'</tpl>'
]
}],
What sort of voodoo do I need to make this work? It is not obvious at all!!!
ATM I am thinking I won't be using ExtJs again - I've found myself in too many dark holes like this recently where things blatantly should just work the way you'd expect - just googling this shows everyone expects this to work. I've used ExtJs on and off for years but I think now is the time to finally admit there are better js application frameworks out there.
Unfortunately, there is no automatic, config-only way of how to do that. If you look at the loadRecord source you see that it just gets data from the passed record and calls setValues on the form.
You would need to override loadRecord method to dig the required values from the associated record(s).
I tried to build a very simple application that creates a store based on two associated models. (It is based on an example you can find here.) This works if I use a shore class name. However, it does not work anymore as soon as I use the class name with the path and the application name, as I was used to do.
I made the following changes:
Changed "Pessoa" to "Aap.model.Pessoa"
Changed "Endereco" to "Aap.model.Endereco"
Could somebody please explain to me:
What is the underlying problem?
What do I have to change in order to make the assosiations work in the second example
Example that works
app.js:
Ext.Loader.setConfig({
enabled: true, // Allows dynamc loading of JavaSCript files
disableCaching: false // Disable random parameter in the URLs path});
Ext.application({
name: 'Aap',
models: ['Pessoa', 'Endereco']});
app/model/Pessoa.js:
Ext.define('Pessoa', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'nome', type: 'string'}
],
proxy: {
type: 'rest',
url: 'data/data',
format: 'json'
},
hasOne: {model: 'Endereco', foreignKey: 'pessoaId'} }
app/model/Endereco.js:
Ext.define('Endereco', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'logradouro', type: 'string'}
]});
data/data.json:
[
{
"id": 1,
"nome": "Loiane",
"sobrenome": "Groner",
"endereco": {
"id": 14,
"logradouro": "rua ficticia",
"numero": "100"
}
},
{
"id": 2,
"nome": "Tom",
"sobrenome": "Stock",
"endereco": {
"id": 34,
"logradouro": "reality street",
"numero": "55"
}
}]
Command in the browser console:
pessoaStore = new Ext.data.Store({
autoLoad: true,
model: 'Pessoa'
});
As a result I get a store with two properly associated model. If I change the class name, however, association does not work anymore.
Example that does not work
app.js:
Ext.Loader.setConfig({
enabled: true, // Allows dynamc loading of JavaSCript files
disableCaching: false // Disable random parameter in the URLs path});
Ext.application({
name: 'Aap',
models: ['Aap.model.Pessoa', 'Aap.model.Endereco']});
app/model/Pessoa.js:
Ext.define('Aap.model.Pessoa', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'nome', type: 'string'}
],
proxy: {
type: 'rest',
url: 'data/data',
format: 'json'
},
hasOne: {model: 'Aap.model.Endereco', foreignKey: 'pessoaId'} }
app/model/Endereco.js:
Ext.define('Aap.model.Endereco', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'logradouro', type: 'string'}
]});
data/data.json:
[
{
"id": 1,
"nome": "Loiane",
"sobrenome": "Groner",
"endereco": {
"id": 14,
"logradouro": "rua ficticia",
"numero": "100"
}
},
{
"id": 2,
"nome": "Tom",
"sobrenome": "Stock",
"endereco": {
"id": 34,
"logradouro": "reality street",
"numero": "55"
}
}]
Command in the browser console:
pessoaStore = new Ext.data.Store({
autoLoad: true,
model: 'Aap.model.Pessoa'
});
Here I get as a result the store with the data of the "Pessoa" model, but the "Endereco" model is not associated and I cannot get the corresponing data.
Any help is appreciated!
I figured out the problem:
In the "app/model/Pessoa.js file" I simply had to replace
hasOne: {model: 'Endereco', foreignKey: 'pessoaId'}
to
hasOne: {model: 'Aap.model.Endereco', associationKey: 'endereco', foreignKey: 'pessoaId'}
Now, the associaiton is working correctly.
The problem the associationKey, which is the property to read the association from. As explained in the ExtJS dcumentation the associationKey is by default the name of the associated moel.
In the first example (the one that worked), this worked well. The associationKey was correspondinly to the model name "Endereco" set to "endereco" by default.
In the second example (the one that did not work), however, the default associationKey did not find any property in the data (app/model/Pessoa.js) with the same name. The associationKey was correspondinly to the model name "Aap.model.Endereco" set to "aap.model.endereco" by default.
The associationKey had therefore to be defined explicitely as "endereco" in order to solve the problem.
I have two models in my ExtJS (4.2.1) application and would like to define a "hasOne" asscociation between the two models. However, I can't make it work.
I tryed to respect the rules for the "hasOne" association as indicated in http://extjs-tutorials.blogspot.ch/2012/05/extjs-belongsto-association-rules.html.
Main Model
Ext.define('Aap.model.TreeNode', {
extend: 'Ext.data.Model',
fields: [
{ name: 'name', type: "string"},
{ name: 'id'},
{ name: 'allgemein_id'}
],
proxy: {
type: 'ajax',
url: 'data/treedata.json',
reader: {
type: 'json',
root: 'nodes',
successProperty: 'success'
}
},
associations: [
{
type: 'hasOne',
model: 'Aap.model.Allgemein',
associationKey: 'metaallgemein',
primaryKey: 'id',
foreignKey: 'allgemein_id',
getterName: 'getAllgemein',
setterName: 'setAllgemein',
autoLoad: true
}
]
});
Associated model
Ext.define('Aap.model.Allgemein', {
extend: 'Ext.data.Model',
requires: 'Aap.model.TreeNode',
fields: [
{name: "name", type: 'string'},
{name: "allgemein_name", type: 'string'},
{name: "ident", type: 'string'},
{name: "georefdat", type: 'string'},
{name: "fachst", type: 'string'},
{name: "zugberech", type: 'string'},
{name: "echkateg", type: 'string'},
{name: "nachfzeitr", type: 'string'},
{name: "datenmenge"},
{name: "imjr"},
{name: "datenzuw"},
{name: "bemerk", type: 'string'},
{name: "treenode_id", type: 'int'},
{name: "id", type: "int"}
],
associations: [
{
type: 'belongsTo',
model: 'Aap.model.TreeNode'
}
],
proxy: {
type: 'ajax',
api: {
read: 'data/allgemeindata.json'
},
reader: {
type: 'json',
root: 'metaallgemein',
successProperty: 'success'
}
}
});
Data for main model
{
"success": true,
"nodes": [
{ "name": "st", "id":"1", "allgemein_id": "1", "expanded": false, "children": [
{ "name": "Geodätische Grundlagen", "id":"4", "allgemein_id": "4", "children": [
{ "name": "Beispiel Datensatz", "id":"6", "allgemein_id": "6", "leaf": true }
]},
{ "name": "Bilddaten", "id":"5", "allgemein_id": "5", "loaded": true}
]},
{ "name": "BU", "id":"2", "allgemein_id": "2", "loaded": true },
{ "name": "BE", "id":"3", "allgemein_id": "3", "loaded": true }
]
}
Data of associated model
{
"success": true,
"metaallgemein": [
{
"name":"st",
"ident": "stident",
"georefdat":"stgeorefdat",
"fachst":"stfach",
"zugberech":"stzugangsbe",
"echkateg":"stechkateg",
"nachfzeitr":"stzeitrnachf",
"datenmenge":"stdatenmende",
"imjr":"stimjr",
"datenzuw":"stdatenzuw",
"bemerk":"stbemerk",
"id": "1",
"treenode_id": "ext-record-1"
},
{
"name":"BU",
"ident": "buident",
"georefdat":"bugeorefdat",
"fachst":"bufach",
"zugberech":"buzugangsbe",
"echkateg":"buechkateg",
"nachfzeitr":"buzeitrnachf",
"datenmenge":"budatenmende",
"imjr":"buimjr",
"datenzuw":"budatenzuw",
"bemerk":"bubemerk",
"id": "2",
"treenode_id": "ext-record-2"
}, ...
...
...
When I load my page and try to get the associated data with my getter, the following happens (see image).
The first time I try to get the associated data (rec.getAllgemein()), I don not get
any data.
When I use the getter a second time (rec.getAllgemein()), I get data, but not the
correct ones. I added a Screenshot helping to explain the problem.
It seem to be a more fundametal problem. Some data are associated, but not correctly. Other record do not have any association.
I tried a simpler example in order to trace the problem. But I did not even achieve to make the association work in the most basic example. It seems that I make somewhere a fundametal mistake:
Ext.define('Aap.model.Person', {
extend: 'Ext.data.Model',
requires: 'Aap.model.Address',
fields: [
{name: 'id', type: 'int'},
{name: 'name', type: 'string'},
{name: 'address_id', type: 'int'}
],
proxy: {
type: 'ajax',
api: {
read: 'data/persons.json'
},
reader: {
type: 'json',
root: 'children',
successProperty: 'success'
}
},
associations: [
{
type: 'hasOne',
model: 'Aap.model.Address'
}
]
});
Ext.define('Aap.model.Address', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id', type: 'int'},
{ name: 'city', type: 'string'}
],
proxy: {
type: 'ajax',
api: {
read: 'data/addresses.json'
},
reader: {
type: 'json',
root: 'children',
successProperty: 'success'
}
}
});
Ext.define('Aap.store.Persons', {
extend: 'Ext.data.Store',
model: 'Aap.model.Person',
autoLoad: 'true',
storeId: 'persons'
});
Ext.define('Aap.store.Addresses', {
extend: 'Ext.data.Store',
model: 'Aap.model.Address',
autoLoad: 'true',
storeId: 'addresses'
});
{
"success": true,
"children": [
{
"id": 1,
"name": "Bernt",
"address_id": 1
},
{
"id": 2,
"name": "Ludowid",
"address_id": 2
}
]
}
{
"success": true,
"children": [
{
"id": 1,
"city": "Berlin"
},
{
"id": 2,
"city": "London"
}
]
}
I don not know where the problem lies.
Is it the model that is not correctly defined?
Is there a problem with the data
Is it the model that is not correctly defined?
Or is it something completely different?
Blog entries such as:
ExtJS 4: Models with Associations and Stores
gave me a better understanding of how associations work. But they did'nt help me to solve the problem.
Thanks for help!
The generated getter should be used asynchronously, you can't rely on the actual return value.
// Don't do that
var unreliableResult = m.getAllgemein();
// Do that instead
m.getAllgemein(function(allgemeinRecord) {
// continue from here...
});
See the part named "Generated getter and setter" in the doc for more information.
Be warned however that the callback implementation seems a bit buggy.
Now, regarding the "wrong" data aspect of your question, your associations configuration seems correct to me. I quickly tested your code, and the correct request (that is, with the correct id for the associated record) was fired... So maybe you should elaborate why you think the data is "wrong", and someone may find the mistake then.
I need to Extjs Tree panel with dynamic remote data(JSON) for file listing.
and the date field name is not fit to Extjs tree store field. so I need to re-mapping to make fit, like adding leaf field and text field.
the return JSON data is like this:
[{
"id":1,
"yourRefNo":"A91273",
"documentName":"Test Document",
"documentFileName":"login_to_your_account-BLUE.jpg",
"updatedBy":"root root",
"updatedAt":"\/Date(1343012244000)\/"
}]
and this is the tree panel:
Ext.define('App.view.Document.DocumentList', {
extend :'Ext.tree.Panel',
rootVisible : false,
alias: 'widget.Document_list',
store: 'DocumentList_store'
});
and this is the store:
Ext.define('App.store.DocumentList_store', {
extend: "Ext.data.TreeStore",
model: 'App.model.DocumentList_model',
proxy: {
type: 'ajax',
url: '/Document/GetDocumentList/',
actionMethods: {
read: 'POST'
},
reader: {
type: 'json',
root: '' // there is no root
},
pageParam: undefined,
startParam: undefined,
pageParam: undefined
},
root: {
children: []
},
autoLoad: false,
listeners: {
append: function (thisNode, newChildNode, index, eOpts) {
console.log(newChildNode.get('documentName')); // 'Test Document'
newChildNode.set('leaf', true);
newChildNode.set('text', newChildNode.get('documentName'));
// it does not add to tree panel.
}
}
});
after load data from server, and it call the append function well. but after that, nothing show up in tree panel.
What I am doing wrong? please advice me.
Thanks
[EDIT]
This is the model,
Ext.define("App.model.DocumentList_model", {
extend: "Ext.data.Model",
fields: [
'id','yourRefNo','documentName','documentFileName','updatedBy','updatedAt'
]
});
I'm fusing your code with a piece of working code of mine. Try see if this works:
Model:
Ext.define("App.model.DocumentList_model", {
extend: 'Ext.data.Model',
fields: [
{name: 'id'},
{name: 'yourRefNo'},
{name: 'documentName' },
{name: 'documentFileName'},
{name: 'updatedBy'},
{name: 'updatedAt', convert: function(v) { return v;} }, // Notice you can do field conversion here
{name: 'leaf', type: 'boolean', defaultValue: false, persist: false},
],
proxy: {
type: 'ajax',
url: '/Document/GetDocumentList/',
actionMethods: {
read: 'POST'
},
reader: {
type: 'json',
root: 'children'
},
},
});
Store:
Ext.define('App.store.DocumentList_store', {
extend: "Ext.data.TreeStore",
model: 'App.model.DocumentList_model',
root: {
text: 'Root',
id: null,
expanded: true
},
autoLoad: false,
});
JSON Response:
{
"success":true,
"children":[{
"id":1,
"yourRefNo":"A91273",
"documentName":"Test Document",
"documentFileName":"login_to_your_account-BLUE.jpg",
"updatedBy":"root root",
"updatedAt":"\/Date(1343012244000)\/",
"leaf":false
}]
}