Created
January 5, 2012 07:44
-
-
Save sunvisor/1564158 to your computer and use it in GitHub Desktop.
Snippet for Ext JS 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet app | |
Ext.application({ | |
name: '${1:AppName}', | |
autoCreateViewport: true, | |
controllers: [ | |
'Controller' | |
], | |
launch: function() { | |
// Initialize | |
} | |
}); | |
snippet controller | |
Ext.define('${1:AppName}.controller.${2:ControllerName}', { | |
extend: 'Ext.app.Controller', | |
init: function () { | |
var me = this; | |
me.control({ | |
'hogectrl': { click: me.hogeClick } | |
}); | |
} | |
}); | |
snippet model | |
Ext.define('${1:AppName}.model.${2:ModelName}', { | |
extend: 'Ext.data.Model', | |
fields: [ | |
'id', | |
'field1' | |
], | |
proxy: { | |
type: 'direct', | |
directFn: ${1:AppName}.${3:directFunction}, | |
reader: { | |
type: 'json', | |
root: 'data', | |
successProperty: 'success' | |
} | |
} | |
}); | |
snippet store | |
Ext.define('${1:AppName}.store.${2:StoreName}', { | |
extend: 'Ext.data.Store', | |
model: ${3:Modelname}, | |
autoLoad: true | |
}); | |
snippet viewport | |
Ext.define('${1:AppName}.view.Viewport', { | |
extend: 'Ext.container.Viewport', | |
layout: 'border', | |
items: [ | |
xtype: 'panel', | |
title: '${2:AppTitle}', | |
layout: 'fit', | |
region: 'center', | |
tbar: { | |
xtype: 'toolbar', | |
items: [ | |
{ | |
xtype: 'button', | |
text: '新規追加' | |
}, | |
{ | |
xtype: 'button', | |
text: '訂正' | |
} | |
] | |
} | |
] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment