icons.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>TextBox with Icons - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>TextBox with Icons</h2>
  14. <p>Click the icons on textbox to perform actions.</p>
  15. <div style="margin:20px 0 40px 0;"></div>
  16. <div style="margin:10px 0 20px 0">
  17. <span>Select Icon Align: </span>
  18. <select onchange="$('#tt').textbox({iconAlign:this.value})">
  19. <option value="right">Right</option>
  20. <option value="left">Left</option>
  21. </select>
  22. </div>
  23. <input id="tt" class="easyui-textbox" style="width:400px" data-options="
  24. prompt: 'Input something here!',
  25. iconWidth: 22,
  26. icons: [{
  27. iconCls:'icon-add',
  28. handler: function(e){
  29. $(e.data.target).textbox('setValue', 'Something added!');
  30. }
  31. },{
  32. iconCls:'icon-remove',
  33. handler: function(e){
  34. $(e.data.target).textbox('clear');
  35. }
  36. },{
  37. iconCls:'icon-search',
  38. handler: function(e){
  39. var v = $(e.data.target).textbox('getValue');
  40. alert('The inputed value is ' + (v ? v : 'empty'));
  41. }
  42. }]
  43. ">
  44. </body>
  45. </html>