HZNM.COM
welcome to my space
X
Search:  
 HOME   [TreePanel] Refreshing data after adding node
[TreePanel] Refreshing data after adding node
Published by: jane 2009-01-09
Welcome to:hznm.com

Hi all,

I`ve been stumbling on this problem since 2 hours, searched the forums & the api docs to no avail and i`m losing my focus on what the solution could be.

I have the following problem; i`m building an treepanel which uses a loader to populate the data. I can add "directories" (basically just nodes with leaf: false) and after that, I can add another directory or page.

/trunk/MapFish/client/mfbase/ext/source/widgets/Container.js ::
A call to this function is required after adding a new component @param { Object} scope (optional) The scope of the function (defaults to current node)
http://www.mapfish.org/trac/mapfish/browser/trunk/MapFish/client/mfbase/ext/source/widgets/Container.js?rev=1045
HOME

I then use an Ajax request to call an php file which will insert the new child node with an appropiate parentId. However, when I`m debugging the parameters posted, I noticed my parentNode`s ID is something like ynode-237, while i`m expecting an integer value from my database.
SfR Fresh: [ktdms-src-oss-3.5.4a.tgz] Member Ext.Panel.html (kt ::
tools:[{ id:'refresh', qtip: 'Refresh form Data', // hidden:true, . A call to this function is required after adding a new component to.
http://www.sfr-fresh.com/unix/privat/ktdms-src-oss-3.5.4a.tgz:a/kt-dms-oss/thirdpartyjs/extjs/docs/output/Ext.Panel.html
HOME

I can understand why its using the ynode: i`m not reloading my nodes after the adding.
What I don`t understand is why, after I try this:


node.reload();


or


parentNode.reload();


The ynode=237 is still the ID of the node. What am I doing wrong? My code is posted below:



// Fired when a new directory has been clicked

onNewNode:
function(editor) {
var node = editor.editNode;
var parentNode = node.parentNode;
var statusBar = Ext.getCmp('main-statusbar');

if(node.parentNode != null && !node.parentNode.isLeaf()){
parentNodeId = parentNode.id;
}
else
{
parentNodeId = '';
}

var options = {
url : 'core.class.php?module=admin&sub=manipulateData',
method : 'GET',
scope : this,
callback : this.cmdCallback,
node : node,
params :
{
action : 'addNode',
text : node.text,
parentId : parentNodeId,
leaf : node.isLeaf()
},
success: function ( response, request ) {
this.statusMessage('Adding directory success!','operationSucces');
},
failure: function ( result, request) {
this.statusMessage('Adding directory Details: '+result.responseText,'operationFailed');
}
};
alert(node.id);
parentNode.reload();
alert(node.id);
Ext.Ajax.request(options);
},


Any pointers to what would be the best solution for this problem would be appreciated :Y


How much does getting a small tattoo on your hip/stomach hurt?
Do anyone else have an itchy anus? ?

You are looking at:hznm.com's [TreePanel] Refreshing data after adding node, click hznm.com to home
  • little tiny menu things
  • closable x on contentpanel tab not showing for some reason
  • preventing clicks from hiding menus
  • 50 solved 2 0 combo default value
  • duplicate events
  • a little help about programing philosophy
  • 2 0 aligning a floating panel to a treenode
  • duplicating forms in dialog on cancel
  • grid header menu vs context menu items
  • grid complex cell content
  • 2 0 grid groupview checkboxselectionmodel
  • using scripttagproxy and ruby on rails
  • playing with formpanel and fieldset
  • hiding the center region
  •  
  • htmleditor and percentage
  • from rev 768 771 is broken the example dynamic
  • accessing the button methods
  • groupview cfg has no properties
  • 2 0 datepicker
  • gridpanel not render inside window
  • field position in the form
  • align windows in center screen
  • form s elements don t scroll
  • imagedragzone multiselection
  • asp net ajax ext
  • how can i compile ext source
  • fallback for loading of a combobox s store
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 hznm.com        Site made:CFZ