/javascript-mode/extjs_component
#! | 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 15 Ext.applyIf(config, { 16 $0 17 }); 18 19 ${1:ClassName}.superclass.constructor.call(this, config); 20}; 21Ext.extend(${1:ClassName}, ${2:Ext.Component}, { 22 /** 23 * ${6:Renders the HTML for this component} 24 * @param {Ext.Container} ct The container to render this component to 25 * @param {Number} position The position within the parent container to render this component to 26 */ 27 onRender: function(ct, position) { 28 this.el = ct.createChild({ 29 $7 30 }); 31 32 ${1:ClassName}.superclass.onRender.apply(this, arguments); 33 } 34}); 35 36${3:Ext.reg('${4:xtype}', ${1:ClassName});}