您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

86 行
2.1 KiB

  1. Dialog Boxes
  2. ============
  3. This document outlines the basic API of the Dialog widget. Dialog boxes are DIV Elements with a border
  4. and are placed at a higher z-index. There is also a basic Form API within the Dialog boxes
  5. Dialog Class
  6. ------------
  7. .. class:: Dialog(w, h, title, content)
  8. To create a basic Dialog box, specify its width, height and title. Optionally, `content` is a list of
  9. form input widgets. For more info, see `make_body`
  10. .. attribute:: wrapper
  11. Enclosing outer DIV element
  12. .. attribute:: head
  13. Element containing the head of the Dialog which contains the title and close btn
  14. .. attribute:: body
  15. Element containing the body of the Dialog
  16. .. attribute:: widgets
  17. Dictionary containing the form widgets. These can be accessed by their labels
  18. .. method:: make_body(content)
  19. content is the list of form input widgets that are to be created. The structure of the `content`
  20. list is a list-in-a-list.
  21. Field widget types are:
  22. * HTML
  23. * Check
  24. * Data
  25. * Select
  26. * Password
  27. * Text
  28. * Button
  29. The widgets are declared as [`type`, `label`, `comment or HTML content`]
  30. .. method:: show()
  31. Show the Dialog
  32. .. method:: hide()
  33. Hide the Dialog
  34. .. method:: set_title(t)
  35. Set the Dialog title
  36. .. method:: no_cancel()
  37. Stop the user from cancelling the Dialog. (The closing of this Dialog must be scripted)
  38. Example
  39. -------
  40. Example showing creation of a Email Dialog::
  41. var d = new Dialog(440, 440, "Send Email");
  42. d.make_body([
  43. ['Data','To','Example: abc@hotmail.com, xyz@yahoo.com']
  44. ,['Select','Format']
  45. ,['Data','Subject']
  46. ,['Data','From','Optional']
  47. ,['Check','Send With Attachments','Will send all attached documents (if any)']
  48. ,['Text','Message']
  49. ,['Button','Send',email_go]]
  50. );
  51. // Reference to a form widget
  52. var emailfrom = d.widgets['From'].value;
  53. // show the dialog
  54. d.show()