Skip to content

Instantly share code, notes, and snippets.

@hvgotcodes
Created September 26, 2010 20:05
Show Gist options
  • Save hvgotcodes/598275 to your computer and use it in GitHub Desktop.
Save hvgotcodes/598275 to your computer and use it in GitHub Desktop.
createChildViews : function() {
var childViews = [], view;
var given = this.getPath('content.given');
this.inputView = view = this.createChildView(SC.LabelView, {
valueBinding: '*content.value',
isEditable: given ? NO : YES,
click: function(evt) {
return this.touchStart(evt);
},
touchStart: function(evt) {
return this.beginEditing();
},
inlineEditorDidEndEditing: function(inlineEditor, finalValue) {
sc_super();
this.getPath('parentView').toggle();
}
// validator: SC.Validator.PositiveInteger
});
view.bind('content', this, 'content');
childViews.push(view);
var hints = [SC.Object.create(...stuff here),];
this.setPath('content.hints', hints);
this.hintView = view = this.createChildView(App.AvailableView, {
layout: {top: 0, left: 0, right: 0, bottom: 0},
backgroundColor: 'green',
content: this.get('content'),
hints: this.getPath('content.hints')
// contentBinding: SC.Binding.from('content', this),
// hintsBinding: SC.Binding.from('content.hints', this)
});
// view.bind('content', this, 'content');
childViews.push(view);
//
this.toggle();
this.set('childViews', childViews);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment