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
// ========================================================================== | |
// myApp.MainMenuController | |
// ========================================================================== | |
require('core'); | |
/** @class | |
(Document Your View Here) | |
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
<%= text_field_view :first_name_id, | |
:hint => "First Name", | |
:enabled => true, | |
:bind => { :value => 'CDFleet.objectController.fname' } | |
%> | |
<% scroll_view :record_list_scroll_view, :height => 200, :width => 300 do %> | |
<%= list_view :record_list, | |
:content_value_key => 'displayString', | |
:bind => { |
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
col = CDFleet.CDObject.collection(); | |
CDFleet.objectsController.set('content', col); | |
col.refresh(); | |
sv = SC.ScrollView.extend({ | |
emptyElement: '<div style="border:1px solid green;height:100px;width:300px;"><div class="id_123abc"></div></div>', | |
outlets: ['listView'], | |
listView: SC.ListView.extend({ | |
contentBinding: 'CDFleet.objectsController.arrangedObjects', | |
selectionBinding: 'CDFleet.objectsController.selection', |
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
col = CDFleet.CDObject.collection(); | |
CDFleet.objectsController.set('content', col); | |
col.refresh(); | |
sv = SC.ScrollView.extend({ | |
emptyElement: '<div style="border:1px solid green;"><div class="id_123abc"></div></div>', | |
outlets: ['listView'], | |
listView: SC.ListView.extend({ | |
contentBinding: 'CDFleet.objectsController.arrangedObjects', | |
selectionBinding: 'CDFleet.objectsController.selection', |
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
_buildOutlets: function (children) { | |
var retOutlets = []; // array of outlet objects | |
children.each(function(child) { | |
retOutlets.push(this._buildOutlet(child)); | |
}, this); // TODO: look into which is best {}, this or {}.bind(this) | |
return retOutlets; | |
}, | |
_buildOutlet: function (child) { | |
var domID = this._viewID(child.guid), // guid id for outlet |
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
// ========================================================================== | |
// CDWeb.CDMainMenuView | |
// ========================================================================== | |
require('core'); | |
/** @class | |
(Document Your View Here) | |
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
_currSelGuid: null, // keep track of current selection guid | |
// myController.addProbe(selection) | |
refreshRecordWhenSelected: function () { | |
// cannot observe selection for changes because of SC.SelectionSupport#updateSelectionAfterContentChange in sproutcore/mixins/selection_support.js | |
// if (!this.didChangeFor('refreshRecordWhenSelected', 'selection')) { return ; } | |
var sel = this.get('selection'), | |
record = null ; | |
if (sel.length == 1) { | |
record = sel.first() ; |
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
CDWeb.CDData = SC.Record.extend( | |
/** @scope CDWeb.CDData.prototype */ { | |
dataSource: CDWeb.server, | |
resourceURL: '/cdweb/rest/data', | |
properties: ['type', 'display_string', 'fname', 'lname' ], | |
primaryKey: 'guid', | |
display_string: 'New Object' | |
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
diff --git a/server/couchdb_server.js b/server/couchdb_server.js | |
index 420f280..66a19db 100755 | |
--- a/server/couchdb_server.js | |
+++ b/server/couchdb_server.js | |
@@ -361,7 +361,7 @@ SC.CouchdbServer = SC.Server.extend({ | |
records.each(function(r) { | |
var primaryKey = r.get('primaryKey') ; | |
var context = { | |
- recordType: this._instantiateRecordType(curRecords[0].get('type'), this.prefix, null), // default rec type. | |
+ recordType: this._instantiateRecordType(r.get('type'), this.prefix, null), // default rec type. |
OlderNewer