M3M0R1X
3 Sep 2011, 2:44 PM
Hi,
I try to display a tree grid panel in a window component. If I open the window the first time everything works fine. But if I close the window and try to open it again the tree grid panel not appears. There are different girds and trees in the same window and they have not this kind of problem. To understand what is going wrong I wrote this example:
Ext.onReady(function() {
Ext.define('Task', {
extend: 'Ext.data.Model',
fields: [
{name: 'task', type: 'string'},
{name: 'user', type: 'string'},
{name: 'duration', type: 'string'}
],
proxy: {
type: 'ajax',
url: 'data.json'
}
});
var store = Ext.create('Ext.data.TreeStore', {
model: 'Task'
});
var tree = Ext.create('Ext.tree.Panel', {
alias: 'widget.newTreePanel',
rootVisible: false,
store: store,
columns: [{
xtype: 'treecolumn',
text: 'Task',
flex: 2,
dataIndex: 'task'
},{
text: 'Duration',
flex: 1,
dataIndex: 'duration'
},{
text: 'Assigned To',
flex: 1,
dataIndex: 'user'
}]
});
Ext.create('Ext.Button', {
text: 'TreeGrid Window',
renderTo: Ext.getBody(),
handler: function() {
Ext.create('Ext.window.Window', {
title: 'TreeGrid',
height: 250,
width: 400,
layout: 'card',
items: [tree]
}).show();
}
});
});
This example comes close to my application even if the error is slightly different.
In my application the panel appears even on the second time but without data. In the example the panel appears not at all at second calling. I think the problem of both is based on the same error.
Could somebody have a look what I am doing wrong?
Thanks in advance
M3M0R1X
I try to display a tree grid panel in a window component. If I open the window the first time everything works fine. But if I close the window and try to open it again the tree grid panel not appears. There are different girds and trees in the same window and they have not this kind of problem. To understand what is going wrong I wrote this example:
Ext.onReady(function() {
Ext.define('Task', {
extend: 'Ext.data.Model',
fields: [
{name: 'task', type: 'string'},
{name: 'user', type: 'string'},
{name: 'duration', type: 'string'}
],
proxy: {
type: 'ajax',
url: 'data.json'
}
});
var store = Ext.create('Ext.data.TreeStore', {
model: 'Task'
});
var tree = Ext.create('Ext.tree.Panel', {
alias: 'widget.newTreePanel',
rootVisible: false,
store: store,
columns: [{
xtype: 'treecolumn',
text: 'Task',
flex: 2,
dataIndex: 'task'
},{
text: 'Duration',
flex: 1,
dataIndex: 'duration'
},{
text: 'Assigned To',
flex: 1,
dataIndex: 'user'
}]
});
Ext.create('Ext.Button', {
text: 'TreeGrid Window',
renderTo: Ext.getBody(),
handler: function() {
Ext.create('Ext.window.Window', {
title: 'TreeGrid',
height: 250,
width: 400,
layout: 'card',
items: [tree]
}).show();
}
});
});
This example comes close to my application even if the error is slightly different.
In my application the panel appears even on the second time but without data. In the example the panel appears not at all at second calling. I think the problem of both is based on the same error.
Could somebody have a look what I am doing wrong?
Thanks in advance
M3M0R1X