Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

FancyUpload2 onComplete Tweek

Posted on 2008-10-18
1
878 Views
Last Modified: 2012-05-05
I'm using FancyUpload2 from:
http://digitarald.de/project/fancyupload/

I have it working great but I want to have the items removed from the list once they are successfully uploaded. I know it must be an easy fix because FancyUpload2 has a onComplete function, I just don't know how to call it.

The main js page is at:
http://digitarald.de/project/fancyupload/2-0/source/FancyUpload2.js

Below is what is on my page.
window.addEvent('load', function() {
 
	var swiffy = new FancyUpload2($('FILE-status'), $('FILE-list'), {
		'url': $('form1').action,
		'fieldName': 'fieldupload',
		'path': 'fancy.swf',
		'onComplete': function () { removeFile(); }, 
		'onLoad': function() {
			$('FILE-status').removeClass('hide');
			$('FILE-fallback').destroy();
		}
	});
 
	/**
	 * Various interactions
	 */
 
	$('FILE-browse-all').addEvent('click', function() {
		swiffy.browse();
		return false;
	});
 
	$('FILE-browse-csv').addEvent('click', function() {
		swiffy.browse({'Images (*.jpg, *.gif)': '*.jpg; *.gif'});
		return false;
	});
 
	$('FILE-clear').addEvent('click', function() {
		swiffy.removeFile();
		return false;
	});
 
	$('FILE-upload').addEvent('click', function() {
		swiffy.upload();
		return false;
	});
 
});

Open in new window

0
Comment
Question by:phper
1 Comment
 
LVL 7

Accepted Solution

by:
mltsy earned 500 total points
ID: 22750312
It looks like, based on the class definition, the "complete" event takes two parameters: file and response, and the "removeFile" function takes one: file.  So, I'm gonna go out on a limb and guess that's the same kind of "file" there.  If that's the case, and I haven't missed anything, you'd basically just need to do this in your definition of swiffy:
...
'onComplete': function (file, response) {
  this.removeFile(file);
},
...

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question