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=1045HOME |
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.htmlHOME |
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? ?
|