toolbarbuttons.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Toolbar and Buttons - 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>Toolbar and Buttons</h2>
  14. <div class="demo-info">
  15. <div class="demo-tip icon-tip"></div>
  16. <div>The toolbar and buttons can be added to dialog.</div>
  17. </div>
  18. <div style="margin:10px 0;">
  19. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#dlg').dialog('open')">Open</a>
  20. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#dlg').dialog('close')">Close</a>
  21. </div>
  22. <div id="dlg" class="easyui-dialog" title="Toolbar and Buttons" style="width:400px;height:200px;padding:10px"
  23. data-options="
  24. iconCls: 'icon-save',
  25. toolbar: [{
  26. text:'Add',
  27. iconCls:'icon-add',
  28. handler:function(){
  29. alert('add')
  30. }
  31. },'-',{
  32. text:'Save',
  33. iconCls:'icon-save',
  34. handler:function(){
  35. alert('save')
  36. }
  37. }],
  38. buttons: [{
  39. text:'Ok',
  40. iconCls:'icon-ok',
  41. handler:function(){
  42. alert('ok');
  43. }
  44. },{
  45. text:'Cancel',
  46. handler:function(){
  47. alert('cancel');;
  48. }
  49. }]
  50. ">
  51. The dialog content.
  52. </div>
  53. </body>
  54. </html>