xzoner
17 Jun 2012, 1:37 AM
Hi, I have the following problem:
Ext.define('app.view.Rubs.TreeStore', { extend: 'Ext.data.TreeStore',
requires: ['app.model.Rubs.RubModel'],
model: app.model.Rubs.RubModel,
folderSort: true,
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
proxy: {
type: 'ajax',
api: {
read: BaseURL+'server/Rubs/readRub.php',
create: BaseURL+'server/Rubs/createRub.php',
update: BaseURL+'server/Rubs/updateRub.php',
destroy: BaseURL+'server/Rub/deleteRub.php'
},
reader: {
type: 'json'
},
writer: {
type: 'json',
writeAllFields: false
},
listeners: {
exception: function(proxy, response, operation){
Ext.MessageBox.show({
title: 'Error',
msg: 'CODE 1001',
icon: Ext.Msg.INFO,
buttons: Ext.Msg.OK
});
},
}
}
}, cfg)]);
}
});
----------------------------------------
Ext.define('app.view.Rubs.TreePanel', {
extend: 'Ext.tree.Panel',
id: 'TreePanel',
title: 'Categories',
width: 500,
height: 300,
collapsible: true,
closable: false,
useArrows: true,
rootVisible: false,
store: new app.view.Rubs.TreeStore(),
multiSelect: true,
singleExpand: false,
stateful: true,
autoscroll: true,
columns: [{
text: '#',
sortable: true,
dataIndex: 'id',
width: 30
},{
xtype: 'treecolumn',
text: 'title',
flex: 2,
sortable: true,
dataIndex: 'title',
editor: {
allowBlank: false
}//end editor
}]
});
I'm doing and I get an error...
...
region: 'center',
xtype: 'tabpanel',
items:[new app.view.Rubs.TreePanel()]
...
Help please! Thanks
Ext.define('app.view.Rubs.TreeStore', { extend: 'Ext.data.TreeStore',
requires: ['app.model.Rubs.RubModel'],
model: app.model.Rubs.RubModel,
folderSort: true,
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
proxy: {
type: 'ajax',
api: {
read: BaseURL+'server/Rubs/readRub.php',
create: BaseURL+'server/Rubs/createRub.php',
update: BaseURL+'server/Rubs/updateRub.php',
destroy: BaseURL+'server/Rub/deleteRub.php'
},
reader: {
type: 'json'
},
writer: {
type: 'json',
writeAllFields: false
},
listeners: {
exception: function(proxy, response, operation){
Ext.MessageBox.show({
title: 'Error',
msg: 'CODE 1001',
icon: Ext.Msg.INFO,
buttons: Ext.Msg.OK
});
},
}
}
}, cfg)]);
}
});
----------------------------------------
Ext.define('app.view.Rubs.TreePanel', {
extend: 'Ext.tree.Panel',
id: 'TreePanel',
title: 'Categories',
width: 500,
height: 300,
collapsible: true,
closable: false,
useArrows: true,
rootVisible: false,
store: new app.view.Rubs.TreeStore(),
multiSelect: true,
singleExpand: false,
stateful: true,
autoscroll: true,
columns: [{
text: '#',
sortable: true,
dataIndex: 'id',
width: 30
},{
xtype: 'treecolumn',
text: 'title',
flex: 2,
sortable: true,
dataIndex: 'title',
editor: {
allowBlank: false
}//end editor
}]
});
I'm doing and I get an error...
...
region: 'center',
xtype: 'tabpanel',
items:[new app.view.Rubs.TreePanel()]
...
Help please! Thanks