PageRenderTime 23ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/javascript-mode/extjs_component

http://github.com/ridgetang/snippets
#! | 36 lines | 32 code | 4 blank | 0 comment | 0 complexity | 00d29b6d99553b367b98c42c062576dc MD5 | raw file
  1. # name : component
  2. # key : component
  3. # group : extjs
  4. # contributor : crazycode@gmail.com
  5. # This was cloned from a TextMate bundle for yasnippet.
  6. # --
  7. /**
  8. * @class ${1:ClassName}
  9. * @extends ${2:Ext.Component}
  10. * ${5:Description}
  11. */
  12. ${1:ClassName} = function(config) {
  13. var config = config || {};
  14. Ext.applyIf(config, {
  15. $0
  16. });
  17. ${1:ClassName}.superclass.constructor.call(this, config);
  18. };
  19. Ext.extend(${1:ClassName}, ${2:Ext.Component}, {
  20. /**
  21. * ${6:Renders the HTML for this component}
  22. * @param {Ext.Container} ct The container to render this component to
  23. * @param {Number} position The position within the parent container to render this component to
  24. */
  25. onRender: function(ct, position) {
  26. this.el = ct.createChild({
  27. $7
  28. });
  29. ${1:ClassName}.superclass.onRender.apply(this, arguments);
  30. }
  31. });
  32. ${3:Ext.reg('${4:xtype}', ${1:ClassName});}