/javascript-mode/extjs.container
http://github.com/ridgetang/snippets · Unknown · 46 lines · 42 code · 4 blank · 0 comment · 0 complexity · 0d03fde63ea7482093e7c76785c266c0 MD5 · raw file
- # name : define container class
- # key : container
- # group : extjs
- # contributor : crazycode@gmail.com
- # This was cloned from a TextMate bundle for yasnippet.
- # --
- /**
- * @class $1
- * @extends $2
- * ${5:Description}
- */
- ${1:ClassName} = function(config) {
- var config = config || {};
- Ext.applyIf(config, {
- $0
- });
- $1.superclass.constructor.call(this, config);
- };
- Ext.extend($1, ${2:Ext.Container}, {
- /**
- * ${6:Renders the HTML for this container}
- * @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
- });
- ${8:
- this.layoutTarget = this.el.child('${9:childSelector}');
- }
- $1.superclass.onRender.apply(this, arguments);
- },
- /**
- * Returns the element to add child components to
- * @return {Ext.Element\} The HTML element child components will be rendered to
- */
- getLayoutTarget: function() {
- return this.layoutTarget;
- \}
- });
- ${3:Ext.reg('${4:xtype}', $1);}