akoval
3 Nov 2012, 8:45 AM
Recently ceased to understand that occurs.
There are two tree panels.
1st created when browser load document.
Viewport... region "west"...items:
title: Ext.app.locale.LocaleManager.get("dbApplication.config_title"),
padding:'0 0 0 0',
autoScroll: true,
items:[{
xtype : 'treepanel',
id: 'config_tree',
hideHeaders: true,
rootVisible: false,
collapsible: false,
heigh:'100%',
width : '100%',
store: Ext.create('Ext.data.TreeStore', {
proxy: {
.....
},
type: 'ajax',
.....
},
autoLoad:false,
clearOnLoad: true,
root: {
text: 'root',
id: 'root',
expanded: true
}
}),
listeners:{
itemclick:function( tree, record, itemHtml, index, e, eOpts ){
Ext.getCmp('export_rules_del_button').setDisabled(false);
Ext.getCmp('center_panel').getLoader().load({
params: {
mode: record.get("id"),
action: 'get_main_panel'
}
});
}
}
}]
The information
{ "children":[
{"id":"db_lang","text":"Languages set","leaf":true},
{"id":"cron_jobs","text":"Cron jobs execution","leaf":true},
{"id":"users_groups","text":"Users and Groups","leaf":true}
] }
loaded in tree and when user select the node, in the itemclick event I have record with proper ID.
By the click on this tree node in the center panel load other trees:
{
layout: {
type: 'hbox',
pack: 'start',
align: 'stretch'
},
items:[{
flex: 1,
xtype: 'groups_users_tree',
id: 'groups_users',
title: 'Groups'
},{
flex: 1,
xtype: 'users_tree',
id: 'users',
title: 'Users list'
},{
title: 'Info',
width: 500
}]
}
The users tree panel has the definition:
Ext.define('Ext.ux.Users', {
extend: 'Ext.panel.Panel', // subclass Ext.Component
alias: 'widget.users_tree',
initComponent: function(){
this.clipBoard = null;
Ext.apply(this, {
layout: 'fit',
style:{
margin:'0px',
padding: '0px'
},
scroll: true,
autoScroll: true,
items:[{
xtype : 'treepanel',
id: 'users_list',
hideHeaders: true,
rootVisible: false,
collapsible: false,
heigh: 'auto',
width : 'auto',
store : userStore,
listeners:{
itemclick:function( treeView, record, item, index, e, eOpts ){
alert("Item select:"+record.get("id"));
Ext.getCmp('users_list').selected_node_id = record.get("id");
}
}
. . .
Info for second tree
{
"success": true,
"children":[
{"id:":"u_1","text":"admin","leaf":true},
{"id:":"u_2","text":"admin2","leaf":true},
{"id:":"u_3","text":"creative","leaf":true}
]
}
All are loaded and showed well. But when I click on the node in the Users tree the record has not id.
I don't understand, why for 1st tree (in west region) in event itemclick I have record with id and for 2nd tree in the same event (itemclick) the id is empty?
I was trying on Exts 4.0.1 and 4.1.1a with the same results.
Thank's
There are two tree panels.
1st created when browser load document.
Viewport... region "west"...items:
title: Ext.app.locale.LocaleManager.get("dbApplication.config_title"),
padding:'0 0 0 0',
autoScroll: true,
items:[{
xtype : 'treepanel',
id: 'config_tree',
hideHeaders: true,
rootVisible: false,
collapsible: false,
heigh:'100%',
width : '100%',
store: Ext.create('Ext.data.TreeStore', {
proxy: {
.....
},
type: 'ajax',
.....
},
autoLoad:false,
clearOnLoad: true,
root: {
text: 'root',
id: 'root',
expanded: true
}
}),
listeners:{
itemclick:function( tree, record, itemHtml, index, e, eOpts ){
Ext.getCmp('export_rules_del_button').setDisabled(false);
Ext.getCmp('center_panel').getLoader().load({
params: {
mode: record.get("id"),
action: 'get_main_panel'
}
});
}
}
}]
The information
{ "children":[
{"id":"db_lang","text":"Languages set","leaf":true},
{"id":"cron_jobs","text":"Cron jobs execution","leaf":true},
{"id":"users_groups","text":"Users and Groups","leaf":true}
] }
loaded in tree and when user select the node, in the itemclick event I have record with proper ID.
By the click on this tree node in the center panel load other trees:
{
layout: {
type: 'hbox',
pack: 'start',
align: 'stretch'
},
items:[{
flex: 1,
xtype: 'groups_users_tree',
id: 'groups_users',
title: 'Groups'
},{
flex: 1,
xtype: 'users_tree',
id: 'users',
title: 'Users list'
},{
title: 'Info',
width: 500
}]
}
The users tree panel has the definition:
Ext.define('Ext.ux.Users', {
extend: 'Ext.panel.Panel', // subclass Ext.Component
alias: 'widget.users_tree',
initComponent: function(){
this.clipBoard = null;
Ext.apply(this, {
layout: 'fit',
style:{
margin:'0px',
padding: '0px'
},
scroll: true,
autoScroll: true,
items:[{
xtype : 'treepanel',
id: 'users_list',
hideHeaders: true,
rootVisible: false,
collapsible: false,
heigh: 'auto',
width : 'auto',
store : userStore,
listeners:{
itemclick:function( treeView, record, item, index, e, eOpts ){
alert("Item select:"+record.get("id"));
Ext.getCmp('users_list').selected_node_id = record.get("id");
}
}
. . .
Info for second tree
{
"success": true,
"children":[
{"id:":"u_1","text":"admin","leaf":true},
{"id:":"u_2","text":"admin2","leaf":true},
{"id:":"u_3","text":"creative","leaf":true}
]
}
All are loaded and showed well. But when I click on the node in the Users tree the record has not id.
I don't understand, why for 1st tree (in west region) in event itemclick I have record with id and for 2nd tree in the same event (itemclick) the id is empty?
I was trying on Exts 4.0.1 and 4.1.1a with the same results.
Thank's