PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/javascript-mode/extjs_con

http://github.com/ridgetang/snippets
#! | 25 lines | 22 code | 3 blank | 0 comment | 0 complexity | 5ea648a56810f1303dc06a4a6145b18b MD5 | raw file
 1# name : con
 2# key : con
 3# group : extjs
 4# contributor : crazycode@gmail.com
 5# This was cloned from a TextMate bundle for yasnippet.
 6# --
 7/**
 8 * @class ${1:MyNamespace}.controllers.${2:${TM_FILENAME/(.+)\.js$/$1/}}
 9 * @extends ${3:Ext.ux.MVC.Controller}
10 * ${4:Description of this controller}
11 */
12${1:MyNamespace}.controllers.${2:${TM_FILENAME/(.+)\.js$/$1/}} = Ext.extend(${3:Ext.ux.MVC.Controller}, {
13  constructor: function() {
14    //super
15    ${1:MyNamespace}.controllers.${2:${TM_FILENAME/(.+)\.js$/$1/}}.superclass.constructor.call(this, {
16      viewsPackage: ${5:$1.views.${2/(.*)Controller$/\l$1/}}
17    });
18    
19    this.actsAsCrudController(${1:MyNamespace}.models.${2/(.*)sController$/$1/});
20  }
21});
22
23Ext.ux.MVC.OS.getOS().registerController('${2/(.*)Controller$/\l$1/}', ${1:MyNamespace}.controllers.${2:${TM_FILENAME/(.+)\.js$/$1/}});
24
25Ext.ns('${1:MyNamespace}.views.${2/(.*)Controller$/\l$1/}');