This file contains hidden or 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
I'm trying to reuse a query object: | |
var q = this._q; | |
if (!q){ | |
q = this._q = SC.Query.create({ | |
recordType: Rapid.Application | |
}); | |
} | |
q.set('conditions', 'currentStep = %@'); | |
q.set('parameters', [this.get('content')]); |
This file contains hidden or 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
Creating the record: | |
var record = Rapid.store.createRecord(Rapid.Check, { | |
guid: '@123' | |
}); | |
relationA.get('checks').pushObject(record); | |
... set up an observer on record status | |
Rapid.store.commitRecords(); | |
the record is created, but relationA.checks points to @123 instead of the storeKey's id (1000) |
This file contains hidden or 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
MyApp.aSimpleController= SC.ObjectController.create({ | |
contentBinding : SC.Binding.single('MyApp.anArrayController.selection') | |
}); | |
MyApp.anotherArrayController= SC.ArrayController.create({ | |
abcBinding: 'MyApp.aSimpleController.content', | |
xyzBinding: SC.Binding.oneWay('MyApp.anotherObjectController.content'), | |
observeMe: function(){ | |
var abc= this.get('abc'); | |
var xyz= this.get('xyz'); |
This file contains hidden or 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
var result = Rapid.store.find(q); | |
result.addObserver('status', Rapid.workflowChecksController, 'checkTypeQueryReturn'); | |
the observer function fires only once with a value for status of null.... what am I doing wrong? |
This file contains hidden or 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
Rapid.isBusyController = SC.ArrayController.create({ | |
isBusy: NO, | |
manageBusyState: function(item){ | |
this.set('isBusy', YES); | |
if (item && (status = item.get('status'))){ | |
while ((status = item.get('status')) & SC.Record.BUSY){ | |
SC.RunLoop.begin(); //<---no affect | |
SC.RunLoop.end(); //<--- i guess the jobs in here affect teh status | |
} |
This file contains hidden or 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
MyApp.SettingsListItemView = SC.View.extend(SC.ContentDisplay,{ | |
layout: {top:0, left:0, width:200, height: 32}, | |
contentDisplayProperties: 'settings somethingElse'.w(), | |
render: function(context, firstTime){ | |
var content = this.get('content'), view; | |
var settings = content.get('settings'); | |
var somethingElse = content.get('somethingElse'); | |
view = this.createChildView(SC.LabelView.design({ | |
//layout however you want | |
value: settings |
This file contains hidden or 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
This works as an ArrayController: | |
Rapid.workflowCurrentApplicationController = SC.ArrayController.create({ | |
contentBinding: SC.Binding.single('Rapid.workflowApplicationsController.selection'), | |
userBinding: SC.Binding.oneWay().from('Rapid.rootWorkflowController.content'), | |
observeMe: function(){ | |
console.log('c '+this.get('content')); | |
console.log('u: '+ this.get('user')); | |
}.observes('content', 'user') | |
}); | |
output |
This file contains hidden or 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
//at a console in firefox: should I see an alert with value 'hi' from the following: | |
q = Rapid.store.find(MyApp.A); | |
q.forEach(function(item){ | |
v = MyApp.store.materializeRecord(item.get('storeKey')); | |
console.log(v); | |
}) | |
//inside of A SC.Record | |
aComputedProperty : function(){ |
This file contains hidden or 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
SC.TableColumn.create({ | |
key: 'phoneType', | |
label: 'Type', | |
exampleView: SC.SelectView, | |
itemsBinding: 'MyApp.telephonetypesController.arrangedObjects', | |
valueBinding: 'phoneType', | |
itemTitleKey: 'displayName' | |
}) | |
The example view displays but is unpopulated.. I think its because the exampleView points to a class and not an object. Is there a way to make the SelectView show up right? |
This file contains hidden or 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
mainView : SC.TabView.design({ | |
layout : { | |
top : 36, | |
left : 40, | |
right : 40, | |
bottom : 40 | |
}, | |
nowShowing : 'stepsView', | |
itemTitleKey : 'title', | |
itemValueKey : 'value', |
NewerOlder