-
29 Jun 2011 4:13 AM #11
Post your code, well see what we find.
-
29 Jun 2011 9:29 AM #12
Reload Node
Reload Node
Hey guys I totally agree node.reload() was easy in pre extjs 4. I found that this works,
yourTreeStore.load({node:record});
if you can get a handle on the Ext.data.TreeStore you can call load on it passing the node you want to reload. Seems to work for me.
thanks,
Russell Holmes
-
30 Jun 2011 2:14 AM #13
Thanks, Russell, that works fine.
The handle to your treestore can be provided by:
yourTreePanel.getStore()
By the way, if you need to do more after loading, the options config for the load method can have a callback function, like:
Code:yourTreePanel.getStore().load({node:yourNode, callback:function() { ...do something useful... } });
-
2 Jul 2011 4:23 AM #14
All
All
Ext.onReady(function()
{
Ext.QuickTips.init();
Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));
store = Ext.create('Ext.data.TreeStore',
{
proxy:
{
type: 'ajax',
url: '/bpm/index.nsf/agentGetFolderList?openagent'
},
reader:{
type: 'json'
},
root: {
text: 'ExtJS',
id: 'src',
expanded: true
},
autoLoad: true,
autoSync: true,
clearOnLoad: true
});
var tb=new Ext.Toolbar(
{
cls:'top-toolbar',
items:
[
{text:document.all.UserInfo.value,id:'UserInfo',icon:'/linkey/bpm/images/r.gif',handler:openurl,cls: 'x-btn-text-icon bmenu'},'-',
{text:'homepage',id:'homepage',icon:'/linkey/bpm/images/icons/fam/task.gif',cls: 'x-btn-text-icon bmenu',handler:openurl},'-',
{text:'mail',id:'mail',icon:'/linkey/bpm/images/icons/fam/mail.gif',cls: 'x-btn-text-icon bmenu',handler:openurl},'-',
{text:'flow',id:'startflow',icon:'/linkey/bpm/images/icons/fam/flow.gif',cls: 'x-btn-text-icon bmenu',handler:openurl}
]
});
var tabs = Ext.createWidget('tabpanel',
{
renderTo: document.body,
activeTab: 0,
autoHeight: true,
defaults :
{
bodyPadding: 10
},
items:[
{
title: 'desktop',
closable: false,
items: [
{
xtype: 'container',
region: 'center',
layout: 'border',
items:[
{
id: 'app-portal',
xtype: 'portalpanel',
region: 'center'
}]
}
]
}]
});
viewport = Ext.create('Ext.Viewport',
{
id: 'border-example',
layout: 'border',
items: [
{
region:'north',
height:70,
margins: '0 0 0 0',
html:"<table width=100% height=100% border=0 cellpadding=0 cellspacing=0 ><tr><td width=50%><img src='"+document.all.logo.value+"'></td></tr></table>",
bbar:tb
},
{
region: 'west',
id:'west-panel',
title:"desktop",
collapsible: true,
xtype: 'treepanel',
width: 152,
autoScroll: true,
split: true,
singleExpand: true,
useArrows: true,
lines: false,
margins: '2 0 3 2',
rootVisible: false,
store: store,
listeners:{itemclick:function(view,record,node,index,e){ShowSubWin(view,record,node,e)}}
},
{
region: 'center',
id: 'center-portal',
items:tabs
}
]
});
function openurl(e)
{
var url="";
if(e.id=="startflow")
{
/*
var proxy = Ext.create('Ext.data.proxy.Proxy',
{
type: 'ajax',
url: "/bpm/linkey_workflow_show.nsf/agentGetFolderList?openagent",
reader:{type: 'json'}
});*/
var operation = new Ext.data.Operation({ action: 'update'});
var proxy = new Ext.data.proxy.Ajax({
url: "/bpm/linkey_workflow_show.nsf/agentGetFolderList?openagent",
reader: 'json'
});
proxy.read(operation);
//var panel = Ext.getCmp("west-panel");
//var data = panel.getStore();
//data.removeAll();
//data.setProxy(proxy);
//data.sync();
//panel.getStore.load({params:{nodeParam:node}});
//panel.setTitle("Test");
//panel.show();
}
}
});
-
2 Jul 2011 4:27 AM #15
All my code occurred error
All my code occurred error
when i click the button 'flow',i want to change the content of the tree in west panel.
in function openurl, i need to refresh the tree,but i do not know how to relize.
//////
Ext.onReady(function()
{
Ext.QuickTips.init();
Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));
store = Ext.create('Ext.data.TreeStore',
{
proxy:
{
type: 'ajax',
url: '/bpm/index.nsf/agentGetFolderList?openagent'
},
reader:{
type: 'json'
},
root: {
text: 'ExtJS',
id: 'src',
expanded: true
},
autoLoad: true,
autoSync: true,
clearOnLoad: true
});
var tb=new Ext.Toolbar(
{
cls:'top-toolbar',
items:
[
{text:document.all.UserInfo.value,id:'UserInfo',icon:'/linkey/bpm/images/r.gif',handler:openurl,cls: 'x-btn-text-icon bmenu'},'-',
{text:'homepage',id:'homepage',icon:'/linkey/bpm/images/icons/fam/task.gif',cls: 'x-btn-text-icon bmenu',handler:openurl},'-',
{text:'mail',id:'mail',icon:'/linkey/bpm/images/icons/fam/mail.gif',cls: 'x-btn-text-icon bmenu',handler:openurl},'-',
{text:'flow',id:'startflow',icon:'/linkey/bpm/images/icons/fam/flow.gif',cls: 'x-btn-text-icon bmenu',handler:openurl}
]
});
var tabs = Ext.createWidget('tabpanel',
{
renderTo: document.body,
activeTab: 0,
autoHeight: true,
defaults :
{
bodyPadding: 10
},
items:[
{
title: 'desktop',
closable: false,
items: [
{
xtype: 'container',
region: 'center',
layout: 'border',
items:[
{
id: 'app-portal',
xtype: 'portalpanel',
region: 'center'
}]
}
]
}]
});
viewport = Ext.create('Ext.Viewport',
{
id: 'border-example',
layout: 'border',
items: [
{
region:'north',
height:70,
margins: '0 0 0 0',
html:"<table width=100% height=100% border=0 cellpadding=0 cellspacing=0 ><tr><td width=50%><img src='"+document.all.logo.value+"'></td></tr></table>",
bbar:tb
},
{
region: 'west',
id:'west-panel',
title:"desktop",
collapsible: true,
xtype: 'treepanel',
width: 152,
autoScroll: true,
split: true,
singleExpand: true,
useArrows: true,
lines: false,
margins: '2 0 3 2',
rootVisible: false,
store: store,
listeners:{itemclick:function(view,record,node,index,e){ShowSubWin(view,record,node,e)}}
},
{
region: 'center',
id: 'center-portal',
items:tabs
}
]
});
function openurl(e)
{
var url="";
if(e.id=="startflow")
{
/*
var proxy = Ext.create('Ext.data.proxy.Proxy',
{
type: 'ajax',
url: "/bpm/linkey_workflow_show.nsf/agentGetFolderList?openagent",
reader:{type: 'json'}
});*/
var operation = new Ext.data.Operation({ action: 'update'});
var proxy = new Ext.data.proxy.Ajax({
url: "/bpm/linkey_workflow_show.nsf/agentGetFolderList?openagent",
reader: 'json'
});
proxy.read(operation);
//var panel = Ext.getCmp("west-panel");
//var data = panel.getStore();
//data.removeAll();
//data.setProxy(proxy);
//data.sync();
//panel.getStore.load({params:{nodeParam:node}});
//panel.setTitle("Test");
//panel.show();
}
}
});
-
3 Aug 2011 10:59 AM #16
ALTERNATIVE
ALTERNATIVE
var node = TreeStore.getNodeById(id);
TreeStore.read({
node: node,
callback: function() {
}
});
-
3 Aug 2011 11:01 AM #17
-
10 Oct 2011 4:12 AM #18
Try to get the node id first, then call the treepanel, then run the reload()
var node_id=menu.item_type+'+'+menu.item_id;
var treePanel= Ext.getCmp('treePanel');
var node = treePanel.getNodeById(node_id);
node.reload();
-
26 Oct 2011 1:59 AM #19
im trying to update node with new data from server side
in console i can see old data in sn new data in n and after sn[0] = n[0]; i can see that sn has new data from n, and after commit i can see that sn has new data from n.PHP Code:tree.getStore().load({node: id, callback:function(n) {
console.log('sn');
console.log(sn);
console.log('n');
console.log(n);
sn[0] = n[0];
console.log('sn re');
console.log(sn);
sn[0].commit();
console.log('sn co');
console.log(sn);
}});
but on event 'selectionchange' on my tree i do console.log(sn); and i can see that sn still has old data.
how can i update node, not his childs?
-
20 Dec 2011 6:22 AM #20
I still can't get this thing to work :-(
When I try this:
That load will be loaded, but it will be the only node under the root node! All other nodes are gone!PHP Code:treeStore.load({
node: node.get("id")
});
How do I just reload the children of a node?
Similar Threads
-
Select the specific node, when refresh the tree
By cramade in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 5 Jan 2011, 1:51 PM -
Focus on the specific node, when refresh the tree.
By cramade in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 7 Jan 2010, 4:21 PM -
Tree Node Refresh 2.2
By millenovecento in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 28 Jan 2009, 8:44 AM -
Refresh Grid content on click event of tree node
By AmitOlsys in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 30 Jul 2008, 11:01 PM


Reply With Quote
