EasyUI Forum
May 03, 2024, 08:15:46 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: I want to hide filebox item, click image obj to trigger filebox to select file  (Read 4722 times)
James
Jr. Member
**
Posts: 52


View Profile Email
« on: September 12, 2018, 08:28:10 AM »

How to do that?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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">
Logged
James
Jr. Member
**
Posts: 52


View Profile Email
« Reply #2 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>
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 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/
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!