⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Drag and drop files



cybersven
  • profile picture
  • Member

Posted 26 February 2014 - 17:43 PM

I'm under OS X 10.9

CI last version

GC last version

Chrome or Safari

 

With a single upload everything is OK

With multiple uploads, if I drag and drop a file on the first upload for example, the same file is setting in every upload input (see attachment)

if I click manually on the input and choose the file it works.

			$crud->set_field_upload('url','assets/uploads/files');
			$crud->set_field_upload('url2','assets/uploads/files2');
			$crud->set_field_upload('url3','assets/uploads/files3');
			$crud->set_field_upload('url4','assets/uploads/files4');

tom_k_17
  • profile picture
  • Member

Posted 01 November 2014 - 20:18 PM

hello,
New to grocery crud , I just had the same issu ...
Digging through the  jquery.fileupload.js file ( assets / grocery_crud / js / jquery_plugins / jquery.fileupload.js ) I found the answer ...
line : 42: "

// The drop target collection , by default the the full document.
// Set to null or empty collection to disable year drag & drop support:
dropzone : $ (document)...,

you just have to change this option in the file
/assets/grocery_crud/js/jquery_plugins/config/jquery.fileupload.config.js

 

line 30 you ill find:
$ (this) .fileupload ({
dataType : ' json '
url: uploader_url ,
cache: false,
acceptFileTypes : file_upload_info.accepted_file_types ,
beforeSend : function ( ) {...

insert : dropZone : $(this)

=>giving that :
$ (this) .fileupload ({
dataType : ' json '
url: uploader_url ,
cache: false,
acceptFileTypes : file_upload_info.accepted_file_types ,
dropZone : $(this), // <--add this
beforeSend : function ( ) {...

 

save it ... and voila

enjoy ...

 

En Français...

Bonjour,
Nouvel utilisateur de grocery crud, je viens juste d'avoir le même probleme...
C'est en fouillant dans le fichier JQUERY fileupload (assets/grocery_crud/js/jquery_plugins/jquery.fileupload.js) que j'ai trouvé la reponse...
ligne : 42 :"

// The drop target collection, by the default the complete document.
// Set to null or an empty collection to disable drag & drop support:
dropZone: $(document),..."

il suffit simplement de modifier cette option dans le fichier
jquery.fileupload.config.js

recherchez ligne 30 :
     $(this).fileupload({
     dataType: 'json',
     url: uploader_url,
     cache: false,
     acceptFileTypes: file_upload_info.accepted_file_types,
            beforeSend: function(){...

inserer :             dropZone:$(this),

ce qui donne:
     $(this).fileupload({
     dataType: 'json',
     url: uploader_url,
     cache: false,
     acceptFileTypes: file_upload_info.accepted_file_types,
dropZone:$(this),
            beforeSend: function(){...
enregistrez ça... et le tour est joué

enjoy...