Created
July 16, 2011 15:12
-
-
Save topherfangio/1086432 to your computer and use it in GitHub Desktop.
Eample of SC SelectAll
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
selectAllClicked: function(evt) { | |
/* | |
* Go ahead and deselect all objects first so that we don't confuse the user | |
*/ | |
Pharos360.studentsController.selectObject(); | |
/* | |
* Now, select only those students that aren't currently selected | |
*/ | |
var students = Pharos360.filteredStudentsController.get('arrangedObjects'); | |
var currentSelection = Pharos360.studentsController.get('selection'); | |
var toSelect = []; | |
students.forEach(function(student) { | |
if (student && student.row && !currentSelection.containsObject(student)) { | |
toSelect.pushObject(student); | |
} | |
}); | |
Pharos360.studentsController.selectObjects(toSelect, YES); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment