Advertisement

Drag and drop folder tree, sending info to server

Moderators: Calcifer, slothy

Drag and drop folder tree, sending info to server

Postby ybuskila » Thu Feb 14, 2008 8:39 am

Hi,

When we click save in js folder tree, the function saveTree sends a string of id-parentid to the server. I need to send much more data, is there a way to add attributes that will be also sent to server, or should I step into the javascript code to add this by my self ?

Thanks, Yaron
ybuskila
 
Posts: 4
Joined: Sun Jan 13, 2008 5:13 pm

Postby ybuskila » Thu Feb 28, 2008 6:50 am

Hi,

Do you already have a working tree view and just want to know how to send data to server ?


As for sending data to server please do the following :

Add this function to youe page in the javascript section :

function saveMyTree(savingAspFile)
{
saveString = treeObj.getSaveString();
var ajaxIndex = ajaxObjects.length;
ajaxObjects[ajaxIndex] = new sack();
var url = savingAspFile+'?saveString=' + saveString;
ajaxObjects[ajaxIndex].requestFile = url; // Specifying which file to get
ajaxObjects[ajaxIndex].onCompletion = function() { saveComplete(ajaxIndex); } ; // Specify function that will be executed after file has been found
ajaxObjects[ajaxIndex].runAJAX(); // Execute AJAX function

}

add a button with onclick = saveMyTree method call. The param aspSaving file is the file which get the GET variables.

the onclick button will call the saveMyTree function which will send a list of pairs of id-parentId to the server.

in the aspSavingFile please write the following code :

echo "<h4>GET variables:</h4>";
foreach($_GET as $key=>$value){
if(is_array($value)){
for($no=0;$no<count($value);$no++){
echo "<b>".$key."[$no]</b>: ".$value[$no]."<br>";
}
}else{
echo "<b>".$key."</b>: ".$value."<br>";
}

}

I am sorry but this is php code pls convert it to asp.

if you use POST replace the GET with it.

now if you have problems to init the tree view please tell me and I will help you.

Yaron
ybuskila
 
Posts: 4
Joined: Sun Jan 13, 2008 5:13 pm


Return to Folder tree questions

Who is online

Users browsing this forum: No registered users and 2 guests