EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: debarcar on September 08, 2015, 03:09:34 AM



Title: Is there easyui form image field?
Post by: debarcar on September 08, 2015, 03:09:34 AM
Hi All,

I used the extjs form image field and wonder if there is similar easyui feature.

Regards!

http://extjs.eu/old-examples/


Title: Re: Is there easyui form image field?
Post by: jarry on September 08, 2015, 08:33:02 AM
No image field component exists. If you wish to preview image before upload, please try to use the filebox. The code below shows how to preview a image before uploading it.
Code:
<img id="image1"/>
<input id="f1" class="easyui-filebox" name="file1" style="width:300px" data-options="
prompt:'Choose a file...',
onChange: function(value){
var f = $(this).next().find('input[type=file]')[0];
if (f.files && f.files[0]){
var reader = new FileReader();
reader.onload = function(e){
$('#image1').attr('src', e.target.result);
}
reader.readAsDataURL(f.files[0]);
}
}">


Title: Re: Is there easyui form image field?
Post by: debarcar on September 08, 2015, 06:30:40 PM
Thanks a lot!