Skip to content

Instantly share code, notes, and snippets.

@bushxnyc
Created March 1, 2012 15:03
Show Gist options
  • Save bushxnyc/1950317 to your computer and use it in GitHub Desktop.
Save bushxnyc/1950317 to your computer and use it in GitHub Desktop.
SelectView valueChange
MyApp.selectedCategoriesController = SC.ArrayController.create({
contentBinding: SC.Binding.oneWay('MyApp.selectedActionController.categories')
});
MyApp.selectedCategoryController = SC.ObjectController.create({
contentBinding: SC.Binding.oneWay('MyApp.categoryListView.menu.selectedItem.value')
});
MyApp.selectedSubCategoriesController = SC.ArrayController.create({
contentBinding: SC.Binding.oneWay('MyApp.selectedCategoryController.subCategories')
});
MyApp.categoryListView = SC.SelectView.create({
layout: { height: 30, width: 100, left: 120, top:15 },
itemsBinding: 'MyApp.selectedCategoriesController.arrangedObjects',
itemTitleKey: 'name',
isActive: YES,
acceptsFirstResponder: YES,
classNames: ['input_full','select-input']
});
MyApp.subCategoryListView = SC.SelectView.create({
layout: { height: 30, width: 100, left: 320, top:15 },
itemsBinding: 'MyApp.selectedSubCategoriesController.arrangedObjects',
itemTitleKey: 'name',
itemValueKey: 'id',
isActive: YES,
acceptsFirstResponder: YES,
classNames: ['input_full','select-input']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment