EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: samuelzhu001 on February 20, 2019, 06:59:04 PM



Title: textbox can not keep value dropped from outside of browser
Post by: samuelzhu001 on February 20, 2019, 06:59:04 PM
     When I drag and drop text from the same page into a textbox,it works,but when I  drag and drop text from other application(e.g., MS Word) into a textbox,the textbox can not hold the value which shows in gray color and disapears when focus is got.
   Is it a bug? How to fix it?


Title: Re: textbox can not keep value dropped from outside of browser
Post by: jarry on February 21, 2019, 07:27:09 AM
Please try to attach the 'drop' event handler on the textbox.
Code:
$('#fname').textbox('textbox').bind('drop', function(e){
setTimeout(function(){
$('#fname').textbox('setValue', e.target.value);
},0);
});


Title: Re: textbox can not keep value dropped from outside of browser
Post by: samuelzhu001 on February 22, 2019, 03:07:18 AM
It works fine. Thanks.