/javascript-mode/extjs_component
http://github.com/ridgetang/snippets · #! · 36 lines · 32 code · 4 blank · 0 comment · 0 complexity · 00d29b6d99553b367b98c42c062576dc MD5 · raw file
- # name : component
- # key : component
- # group : extjs
- # contributor : crazycode@gmail.com
- # This was cloned from a TextMate bundle for yasnippet.
- # --
- /**
- * @class ${1:ClassName}
- * @extends ${2:Ext.Component}
- * ${5:Description}
- */
- ${1:ClassName} = function(config) {
- var config = config || {};
-
- Ext.applyIf(config, {
- $0
- });
-
- ${1:ClassName}.superclass.constructor.call(this, config);
- };
- Ext.extend(${1:ClassName}, ${2:Ext.Component}, {
- /**
- * ${6:Renders the HTML for this component}
- * @param {Ext.Container} ct The container to render this component to
- * @param {Number} position The position within the parent container to render this component to
- */
- onRender: function(ct, position) {
- this.el = ct.createChild({
- $7
- });
-
- ${1:ClassName}.superclass.onRender.apply(this, arguments);
- }
- });
- ${3:Ext.reg('${4:xtype}', ${1:ClassName});}