EasyUI Forum
May 21, 2024, 03:54:55 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Filebox multiple files  (Read 7423 times)
proceno72
Newbie
*
Posts: 39



View Profile
« on: March 02, 2016, 08:10:58 AM »

I'm using easyui-filebox plugin, but i can't select multiple files. How can I enable this feature?
Logged
proceno72
Newbie
*
Posts: 39



View Profile
« Reply #1 on: March 02, 2016, 10:08:55 AM »

Ok, maybe i found a solution.
Code:
$('#fb').filebox({
   buttonText: 'Select...',
   onChange: function (newValue, oldValue) {
   // This to show all files list on the textbox (otherwise it shows only last selected file with the "fakepath" issue)
            var f = $('#fb').next().find('.textbox-value');
            var listfiles = '';
            $.each(f[0].files, function(index, item) {
                if (listfiles.length > 0) { listfiles = listfiles + ', '+ '"'+item.name+'"'; }
                else { listfiles = '"'+item.name+'"'; }
            });
            $(this).textbox('setText',listfiles);
   }
});

// This to set the right property "multiple" on the input file tag
$('#fb').next().find('.textbox-value').prop('multiple',true);
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!