You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.3 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-menu-TextItem-method-constructor'><span id='Ext-menu-TextItem'>/**
  19. </span></span> * @class Ext.menu.TextItem
  20. * @extends Ext.menu.BaseItem
  21. * Adds a static text string to a menu, usually used as either a heading or group separator.
  22. * @constructor
  23. * Creates a new TextItem
  24. * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it
  25. * is applied as a config object (and should contain a &lt;tt&gt;text&lt;/tt&gt; property).
  26. * @xtype menutextitem
  27. */
  28. Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, {
  29. <span id='Ext-menu-TextItem-cfg-text'> /**
  30. </span> * @cfg {String} text The text to display for this item (defaults to '')
  31. */
  32. <span id='Ext-menu-TextItem-cfg-hideOnClick'> /**
  33. </span> * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
  34. */
  35. hideOnClick : false,
  36. <span id='Ext-menu-TextItem-cfg-itemCls'> /**
  37. </span> * @cfg {String} itemCls The default CSS class to use for text items (defaults to &quot;x-menu-text&quot;)
  38. */
  39. itemCls : &quot;x-menu-text&quot;,
  40. constructor : function(config) {
  41. if (typeof config == 'string') {
  42. config = {
  43. text: config
  44. };
  45. }
  46. Ext.menu.TextItem.superclass.constructor.call(this, config);
  47. },
  48. <span id='Ext-menu-TextItem-method-onRender'> // private
  49. </span> onRender : function() {
  50. var s = document.createElement(&quot;span&quot;);
  51. s.className = this.itemCls;
  52. s.innerHTML = this.text;
  53. this.el = s;
  54. Ext.menu.TextItem.superclass.onRender.apply(this, arguments);
  55. }
  56. });
  57. Ext.reg('menutextitem', Ext.menu.TextItem);</pre>
  58. </body>
  59. </html>