EasyUI Forum
September 14, 2025, 02:14:39 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: Is there easyui form image field?  (Read 10189 times)
debarcar
Newbie
*
Posts: 9


View Profile
« 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/
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 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]);
}
}">
Logged
debarcar
Newbie
*
Posts: 9


View Profile
« Reply #2 on: September 08, 2015, 06:30:40 PM »

Thanks a lot!
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!