andy_ghg
2 Nov 2012, 2:01 AM
Happy Halloween.
This is my 'model' code here:
Ext.define('SystemSetup.model.SYSMenu', {
extend : 'Ext.data.Model',
fields : [{
name : 'task',
type : 'string'
}, {
name : 'user',
type : 'string'
}, {
name : 'duration',
type : 'string'
}, {
name : 'done',
type : 'boolean'
}]
});
Then, I create a new 'Store' and use 'SystemSetup.model.SYSMenu':
Ext.define("SystemSetup.store.SYSMenus",{
extend : "Ext.data.TreeStore",
model : "SystemSetup.model.SYSMenu",
proxy : {
type : 'ajax',
//the store will get the content from the .json file
url : 'data/treegrid.json'
},
folderSort : true
});
But when I run this application, Ext JS can not autoload 'SystemSetup.model.SYSMenu' file.
So I changed 'Ext.data.TreeStore' parent class just like this:
Ext.define('Ext.data.TreeStore', {
extend: 'Ext.data.Store',
//..........
It's running fine. Who can tell me is that a bug? If that is not a bug, could you tell me how can I fix it?
Could it be that just like that?
Hope you all give me a reply. Thank you guys~!
This is my 'model' code here:
Ext.define('SystemSetup.model.SYSMenu', {
extend : 'Ext.data.Model',
fields : [{
name : 'task',
type : 'string'
}, {
name : 'user',
type : 'string'
}, {
name : 'duration',
type : 'string'
}, {
name : 'done',
type : 'boolean'
}]
});
Then, I create a new 'Store' and use 'SystemSetup.model.SYSMenu':
Ext.define("SystemSetup.store.SYSMenus",{
extend : "Ext.data.TreeStore",
model : "SystemSetup.model.SYSMenu",
proxy : {
type : 'ajax',
//the store will get the content from the .json file
url : 'data/treegrid.json'
},
folderSort : true
});
But when I run this application, Ext JS can not autoload 'SystemSetup.model.SYSMenu' file.
So I changed 'Ext.data.TreeStore' parent class just like this:
Ext.define('Ext.data.TreeStore', {
extend: 'Ext.data.Store',
//..........
It's running fine. Who can tell me is that a bug? If that is not a bug, could you tell me how can I fix it?
Could it be that just like that?
Hope you all give me a reply. Thank you guys~!