Skip to content

Instantly share code, notes, and snippets.

import org.apache.catalina.loader.WebappLoader
eventConfigureTomcat = { tomcat ->
def newContextRoot = "/extjs_src"
File newContextPath = new File( "C:/Developer/Tools/javascript/ext-4.2.0.663/src" )
if( newContextPath.exists() ) {
context = tomcat.addWebapp( newContextRoot, newContextPath.getAbsolutePath() )
context.reloadable = true
WebappLoader loader = new WebappLoader( tomcat.class.classLoader )
select revisions from dir "/"
where
(path like "/**/your_project_root/src/main/**/*.coffee"
or path like "/**/your_project_root/src/main/**/*.jsp")
and is head
and not is deleted
and on branch develop
group by path
return path
Ext.define( "DeftQuickStart.DeftQuickStartApplication",
extend: "Deft.mvc.Application"
init: ->
console.log( "Init in Application" )
Deft.Injector.configure(
companyStore: "DeftQuickStart.store.CompanyStore"
)
Ext.Loader.setConfig(
enabled: true
paths:
"DeftQuickStart": "app/"
)
Ext.application
autoCreateViewport: false
name: "DeftQuickStart"
Ext.Loader.setConfig(
enabled: true
paths:
"DeftQuickStart": "app/"
)
Ext.application
autoCreateViewport: true
name: "DeftQuickStart"
var myMethod;
myMethod = function(firstArgument, _arg) {
var objectValue1, objectValue2;
objectValue1 = _arg.objectValue1, objectValue2 = _arg.objectValue2;
};
myMethod = ( firstArgument, { objectValue1, objectValue2 } ) ->
# do something
# Using a Promise
loadCompanies: ->
@companyService.loadCompanies().then(
success: ( records ) ->
# Do something with results
failure: ( error ) ->
# Do something with the error
).always( ->
# Do something whether the call succeeded or failed
)
# Common way of making async call via underlying Store
loadCompanies: ->
@companyService.loadCompanies(
callback: ( records, operation, success ) ->
if( success )
# Do something with results
else
# Do something with the error
# Do something whether the call succeeded or failed
# Using a Promise for a chain of async calls
loadInitialData: ->
@companyService.loadInitialData().then(
success: ( records ) ->
# Do something with results
failure: ( error ) ->
# Do something with the error
).always( ->
# Do something whether the call succeeded or failed
)