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

Notification

Icon
Error

Options
Go to last post Go to first unread
TLove  
#1 Posted : Thursday, January 15, 2015 6:20:03 AM(UTC)
TLove

Rank: Member

Groups: Member
Joined: 7/25/2007(UTC)
Posts: 17

Thanks: 3 times
Hello,

I recently updated to version 8.1.15 of the ImageUploader and it seems like there has been a change to how the uploadFileCountChange event works. Previously, I was using this event to add a select list to the panelItem which was working just fine. Now, it seems like the uploadFileCountChange event is triggered before the panelItem is added to the the uploadPane. I don't want to have to go back to a previous version as 8.1.15 has added a new addFiles() function to the uploadPane that is very useful. Is there another event I could use that is triggered after the HTML is inserted into the uploadPane? The reason I need this is because the user must select the type of document they are uploading for each file. Any suggestions? My code for the event handler is below.

Code:

function _addDocumentTypeToForm(type) {
  if (type == 'add') {
    $('li.au-upldr-list-item').not(':has(div[id^="documentTypes"])').each$(function(index, $listItem) {
      var $documentTypes = $('#documentTypes').clone();
      var id = $listItem.attr('id');
      $documentTypes.attr('id', 'documentTypes' + id).removeClass('hidden');
      $documentTypes.find('label').attr('for', 'documentType_' + index);
      $documentTypes.find('#documentType').attr('id', 'documentType_' + index);
      $listItem.append($documentTypes);
    });
  }
}
-Tim
Andrew  
#2 Posted : Friday, January 16, 2015 3:14:28 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 868

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
It looks like you are trying to modify the DOM representation of the upload item. In fact I afraid it won't work reliably because the upload item is not always exists even after you add files to the upload list due to the memory/performance reasons. If you add too many items to the uploader, upload items won't be created until you scroll down. The upper items may be removed.

Previous versions did not have such optimization, so your approach worked (however there were problems with uploads containing hundreds of files).

In the next version we are going to add an ability to access the preview image of an item in the upload list. It will allow you building your own upload list panel. Something similar to Multiple Description demo in our Java/ActiveX uploader.

BTW, how many items in average your users will send?
TLove  
#3 Posted : Tuesday, January 20, 2015 5:31:41 AM(UTC)
TLove

Rank: Member

Groups: Member
Joined: 7/25/2007(UTC)
Posts: 17

Thanks: 3 times
Andrew,

Thank you for your response. I understand that what I was doing was not supported and why the optimization that was made. Could you give me a rough ETA on the next version? I only ask because I am working on a project that will require me to submit this extra field with each document being uploaded. I will need to let management know when I can expect to be able to continue.

Other than adding another event that would be triggered once the item was added to the DOM, I can't think of another way to accomplish what I am looking to do.

I don't see our users adding more than a few items at a time. We are using your product to allow our users to upload files and photos for their insurance policy.

Thank you once again for your time!
-Tim
Andrew  
#4 Posted : Wednesday, January 28, 2015 1:49:01 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 868

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
I believe it would take few more weeks to finish it, prepare code examples and update documentation.
TLove  
#5 Posted : Wednesday, January 28, 2015 4:48:14 AM(UTC)
TLove

Rank: Member

Groups: Member
Joined: 7/25/2007(UTC)
Posts: 17

Thanks: 3 times
I understand. Thank you for the update.
-Tim
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.