EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on October 19, 2017, 08:31:46 PM



Title: Filebox accept does not seem to work
Post by: devnull on October 19, 2017, 08:31:46 PM
This allows me to select any file and does not limit the selection to .xls, .xlsx files ??

Code:
        $('#xfiles').filebox({
          multiple: false,
          buttonText: 'Choose File',
          buttonAlign: 'left',
          accept:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel',
          onChange: function(nv,ov){
            $(this).textbox('textbox')[0].value = nv.replace("C:\\fakepath\\", "");
            var tgt = $(this).next().find('.textbox-value')[0];
            xl2json(tgt,function(res){
              alert(JSON.stringify(res))
          });       
          }
        })


Title: Re: Filebox accept does not seem to work
Post by: stworthy on October 19, 2017, 11:46:34 PM
Some browsers don't support the 'accept' property. If you are using IE9 or lower versions, this property accept will be ignored.


Title: Re: Filebox accept does not seem to work
Post by: devnull on October 20, 2017, 06:24:01 AM
Thanks, I am using chrome latest version ?


Title: Re: Filebox accept does not seem to work
Post by: stworthy on October 20, 2017, 08:09:59 AM
The 'accept' property does not supported in version 1.4.4. To solve this issue, please download the patch from https://www.jeasyui.com/download/downloads/jquery-easyui-1.4.4-patch.zip.