Skip to content

Instantly share code, notes, and snippets.

MT.ReportTemplateContainerView = SC.ContainerView.extend({
contentView: SC.TemplateView.extend({
itemBinding: 'MT.reportTemplates.selectedItem',
templateName: 'report_template_show'
}),
editView: SC.TemplateView.extend({
itemBinding: 'MT.reportTemplates.selectedItem',
templateName: 'report_template_edit'
})
});
@gmoeck
gmoeck / setupApplication.js
Created May 28, 2011 14:20
setupApplication.js
// This file is the setup for integration testing file
// This ultimetly should be moved somewhere else, but not sure yet where
setupApplication = function () {
beforeEach(function() {
TW.statechart.initStatechart();
Fictum.setup();
Fictum.addResourceType('Item', {
...
});
App.NoticeCollectionView = SC.TemplateCollectionView.extend({
contentBinding: 'App.noticesListController',
tagName: 'div',
classNames: ['message', 'notices'],
itemView: SC.TemplateView.extend({
tagName: 'p',
classNames: ['notice']
})
})
{{#view id="messages" isVisibleBinding="App.noticesListController.isEmpty"}}
{{#collection App.NoticeCollectionView }}
{{content.body}}
<a class="hide">Dismiss</a>
{{/collection}}
{{/view}}
Onetoone.Model1 = SC.Record.extend(
model1Value: SC.Record.attr(String, {}),
model2: SC.Record.toOne('Onetoone.Model2', {inverse:'model1', isMaster: NO})
}) ;
Handlebars.registerHelper('unbound', function(property, fn) {
return this.get(property);
});
list: SC.ScrollView.extend({
layout: {height:190},
contentView: SC.TemplateCollectionView.extend({
contentBinding: 'TW.homePageTabsController.contentRecentSearches',
itemView: SC.TemplateView.extend(TW.ItemViewSelectionSupport, {
templateName: 'home_page_tabs_recent_search_item',
classNames: ['simple-link-row'],
performAction: function() {
TW.statechart.sendEvent('performRecentSearch', this.get('content'));
@gmoeck
gmoeck / output.html
Created June 25, 2011 17:52
table_example.handlebars
<table>
<tbody tabindex="-1" id="sc201" class="">
<tr tabindex="-1" id="sc210" class="" style="">
<td tabindex="-1" id="sc214" class="" style=""><span tabindex="-1" id="sc216" class="" style="">something</span></td>
<td tabindex="-1" id="sc220" class="" style=""><span tabindex="-1" id="sc221" class="" style="">new</span></td>
</tr>
<tr tabindex="-1" id="sc225" class="" style="">
<td tabindex="-1" id="sc228" class="" style=""><span tabindex="-1" id="sc229" class="" style="">something</span></td>
<td tabindex="-1" id="sc232" class="" style=""><span tabindex="-1" id="sc233" class="" style="">else</span></td>
</tr>
@gmoeck
gmoeck / started.js
Created July 18, 2011 16:09
Started State
App.StartedState = SC.State.extend({
enterState: function() {
//do some stuff
this.setupRoutes();
},
exitState: function() {
//remove some stuff
},
{{#if booleanA}}
{{propertyA}}
{{/if}}
{{#if booleanB}}
{{propertyB}}
{{/if}}
//should be