EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: James on September 12, 2018, 08:28:10 AM



Title: I want to hide filebox item, click image obj to trigger filebox to select file
Post by: James on September 12, 2018, 08:28:10 AM
How to do that?


Title: Re: I want to hide filebox item, click image obj to trigger filebox to select file
Post by: jarry on September 12, 2018, 08:35:28 PM
Custom the style to make the button full fill the whole component.
Code:
<style type="text/css">
.fb1 .textbox-button{
width: 100%;
}
</style>
<input class="easyui-filebox" data-options="cls:'fb1',width:100">


Title: Re: I want to hide filebox item, click image obj to trigger filebox to select file
Post by: James on September 12, 2018, 11:38:44 PM
Custom the style to make the button full fill the whole component.
Code:
<style type="text/css">
.fb1 .textbox-button{
width: 100%;
}
</style>
<input class="easyui-filebox" data-options="cls:'fb1',width:100">
You missunderstand me. I mean totally hide filebox, click image item to make filebox work.
http://jsfiddle.net/5jkew2uf/2/
Code:
        <img id="imageshow" src="" style="width:100px;height:100px">
        <div style="display:none">
          <input id="filebox" class="easyui-filebox">
        </div>
        <script>
            $(function () {
                $('#imageshow').click(function(){
                //here to click filebox's "Choose File" button
                })
            });
        </script>


Title: Re: I want to hide filebox item, click image obj to trigger filebox to select file
Post by: jarry on September 13, 2018, 01:05:44 AM
Call this line to trigger the filebox to choose a file.
Code:
$('#filebox').next().find('.textbox-value')[0].click();

The example is available from http://jsfiddle.net/5jkew2uf/5/