Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
bjb  
#1 Posted : Saturday, July 15, 2006 6:04:06 PM(UTC)
bjb

Rank: Member

Groups: Member
Joined: 1/17/2006(UTC)
Posts: 18

Hi,

is there a way to fire an event if a users arranges the files in the upload pane manually and sort order is already "unsorted"?

Fedor  
#2 Posted : Sunday, July 16, 2006 5:32:21 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Quote:
is there a way to fire an event if a users arranges the files in the upload pane manually and sort order is already "unsorted"?

There is no such event, but you can implement in JavaScript upload pane watcher with help of which you could handle the order change. Here is the code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Aurigma Image Uploader - Basic Demo</title>

	<script type="text/javascript" src="../iuembed.js"></script>

</head>
<body>
		<script type="text/javascript">
var fileOrder;
var imageUploader1;

function fullPageLoad(){	
	imageUploader1=getImageUploader("ImageUploader1");
	saveFileOrder();
	window.setInterval("watchFileOrder()", 400);
}

//Save current file order
function saveFileOrder(){
	fileOrder = new Array();
	var c = imageUploader1.getUploadFileCount();
	for (i = 1; i <= c; i++){
		fileOrder[i] = imageUploader1.getUploadFileGuid(i);
	}
}

//Check whether file order was changed
function watchFileOrder(){
	var c = imageUploader1.getUploadFileCount();
	for (i = 1; i <= c; i++){		
		if (fileOrder[i] != imageUploader1.getUploadFileGuid(i)){
			saveFileOrder();
			ImageUploader1_OrderChanged();
			break;
		}
	}	
}

//Handle upload file count change
function ImageUploader1_UploadFileCountChange(){
	if (imageUploader1){
		ImageUploader1_OrderChanged();
		saveFileOrder();	
	}
}

//Handle sort mode change
function ImageUploader1_SortModeChange(pane) {
	if (imageUploader1 && (pane==1)){
		ImageUploader1_OrderChanged();
		saveFileOrder();
	}
}

//Callback on file order change
function ImageUploader1_OrderChanged(){
	//Your code on order change
	alert("OrderChanged!");
}


//-----------------------------------------------------------------------------------
var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);

//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../ImageUploader4.cab";
iu.activeXControlVersion = "4,0,33,0";

//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletCodeBase = "../";
iu.javaAppletCached = true;
iu.javaAppletVersion = "2.0.29.0";

iu.addParam("PaneLayout", "ThreePanes");

iu.addEventListener("UploadFileCountChange", "ImageUploader1_UploadFileCountChange");
iu.addEventListener("SortModeChange", "ImageUploader1_SortModeChange");
iu.fullPageLoadListenerName = "fullPageLoad";

iu.writeHtml();

	</script>
	
</body>
</html>

Edited by user Monday, February 18, 2008 6:13:09 PM(UTC)  | Reason: Not specified

Best regards,

Fedor Skvortsov

bjb  
#3 Posted : Sunday, July 16, 2006 7:19:08 PM(UTC)
bjb

Rank: Member

Groups: Member
Joined: 1/17/2006(UTC)
Posts: 18

Thanks a lot!

Best regards

Bernd

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.