toolbarbuttons.html 1.4 KB

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