Created
June 5, 2014 06:28
-
-
Save topherfangio/5919b2311a5311a3e343 to your computer and use it in GitHub Desktop.
Double Autocomplete view with new BT
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
/* begin of file /Users/topher/Documents/Development/profoundry/colla/frameworks/scui2/views/autocomplete.js */ | |
SC.AutocompleteInputView = SC.TextFieldView.extend({ | |
layout: { width: 200, height: 24 }, | |
hint: 'Type here...', | |
valueBinding: 'Craft.testController.someValue', | |
isEditable: YES, | |
beginEditing: function() { | |
return YES; | |
} | |
}); | |
SC.AutocompleteSelectionView = SC.View.extend(SC.AutoResize, { | |
supportsAutoResize: YES, | |
canEditContent: YES, | |
layout: { width: 50, height: 24 }, | |
autoResizeLayer: function() { | |
return this.get('layer'); | |
}.property('layer'), | |
autoResizeText: " *** woot", | |
render: function(context) { | |
context.push(' *** woot'); | |
} | |
}); | |
SC.AutocompleteView = SC.CollectionView.extend(SC.FlowedLayout, { | |
defaultFlowSpacing: { left: 10, right: 10, top: 10, bottom: 10 } | |
}); | |
/* end of file /Users/topher/Documents/Development/profoundry/colla/frameworks/scui2/views/autocomplete.js */ | |
/* begin of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ | |
SC.AutocompleteInputView = SC.TextFieldView.extend({ | |
layout: { width: 200, height: 24 }, | |
hint: 'Type here...', | |
valueBinding: 'Craft.testController.someValue', | |
isEditable: YES, | |
beginEditing: function() { | |
return YES; | |
} | |
}); | |
SC.AutocompleteSelectionView = SC.View.extend(SC.AutoResize, { | |
supportsAutoResize: YES, | |
canEditContent: YES, | |
layout: { width: 50, height: 24 }, | |
autoResizeLayer: function() { | |
return this.get('layer'); | |
}.property('layer'), | |
autoResizeText: " *** woot", | |
render: function(context) { | |
context.push(' *** woot'); | |
} | |
}); | |
SC.AutocompleteView = SC.StackedView.extend(SC.FlowedLayout, { | |
defaultFlowSpacing: { left: 10, right: 10, top: 10, bottom: 10 } | |
}); | |
/* end of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ | |
/* begin of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ | |
SC.AutocompleteInputView = SC.TextFieldView.extend({ | |
layout: { width: 200, height: 24 }, | |
hint: 'Type here...', | |
valueBinding: 'Craft.testController.someValue', | |
isEditable: YES, | |
beginEditing: function() { | |
return YES; | |
} | |
}); | |
SC.AutocompleteSelectionView = SC.View.extend(SC.AutoResize, { | |
supportsAutoResize: YES, | |
canEditContent: YES, | |
layout: { width: 50, height: 24 }, | |
autoResizeLayer: function() { | |
return this.get('layer'); | |
}.property('layer'), | |
autoResizeText: " *** woot", | |
render: function(context) { | |
context.push(' *** woot'); | |
} | |
}); | |
SC.AutocompleteView = SC.View.extend(SC.FlowedLayout, { | |
defaultFlowSpacing: { left: 10, right: 10, top: 10, bottom: 10 }, | |
contentDidChange: function() { | |
var content = this.get('content'), | |
childViews = []; | |
if (content) { | |
content.forEach(function(c) { | |
childViews = this.appendChild(this.createChildView(SC.getPath(c.get(c.get('contentExampleViewKey'))))); | |
}); | |
} | |
this.set('childViews', childViews); | |
}.observes('content') | |
}); | |
/* end of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ | |
/* begin of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ | |
SC.AutocompleteInputView = SC.TextFieldView.extend({ | |
layout: { width: 200, height: 24 }, | |
hint: 'Type here...', | |
valueBinding: 'Craft.testController.someValue', | |
isEditable: YES, | |
beginEditing: function() { | |
return YES; | |
} | |
}); | |
SC.AutocompleteSelectionView = SC.View.extend(SC.AutoResize, { | |
supportsAutoResize: YES, | |
canEditContent: YES, | |
layout: { width: 50, height: 24 }, | |
autoResizeLayer: function() { | |
return this.get('layer'); | |
}.property('layer'), | |
autoResizeText: " *** woot", | |
render: function(context) { | |
context.push(' *** woot'); | |
} | |
}); | |
SC.AutocompleteView = SC.View.extend(SC.FlowedLayout, { | |
defaultFlowSpacing: { left: 10, right: 10, top: 10, bottom: 10 }, | |
contentDidChange: function() { | |
var content = this.get('content'), | |
childViews = []; | |
if (content) { | |
content.forEach(function(c) { | |
console.log(' *** adding child view...'); | |
childViews = this.appendChild(this.createChildView(SC.getPath(c.get(c.get('contentExampleViewKey'))))); | |
}); | |
} | |
this.set('childViews', childViews); | |
}.observes('content') | |
}); | |
/* end of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ | |
/* begin of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ | |
SC.AutocompleteInputView = SC.TextFieldView.extend({ | |
layout: { width: 200, height: 24 }, | |
hint: 'Type here...', | |
valueBinding: 'Craft.testController.someValue', | |
isEditable: YES, | |
beginEditing: function() { | |
return YES; | |
} | |
}); | |
SC.AutocompleteSelectionView = SC.View.extend(SC.AutoResize, { | |
supportsAutoResize: YES, | |
canEditContent: YES, | |
layout: { width: 50, height: 24 }, | |
autoResizeLayer: function() { | |
return this.get('layer'); | |
}.property('layer'), | |
autoResizeText: " *** woot", | |
render: function(context) { | |
context.push(' *** woot'); | |
} | |
}); | |
SC.AutocompleteView = SC.View.extend(SC.FlowedLayout, { | |
defaultFlowSpacing: { left: 10, right: 10, top: 10, bottom: 10 }, | |
contentDidChange: function() { | |
console.log(' *** conentDidChange'); | |
var content = this.get('content'), | |
childViews = []; | |
if (content) { | |
content.forEach(function(c) { | |
console.log(' *** adding child view...'); | |
childViews = this.appendChild(this.createChildView(SC.getPath(c.get(c.get('contentExampleViewKey'))))); | |
}); | |
} | |
this.set('childViews', childViews); | |
}.observes('content') | |
}); | |
/* end of file /Users/topher/Documents/Development/profoundry/scui2/views/autocomplete.js */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment