enable checking of child checkboxes

This commit is contained in:
Andrew Dolgov 2011-11-10 16:16:38 +04:00
parent 227cdb7222
commit bd4dfcae6e
1 changed files with 61 additions and 59 deletions

View File

@ -57,11 +57,12 @@ dojo.declare( "lib.CheckBoxStoreModel", dijit.tree.TreeStoreModel,
// example: // example:
// | model.updateCheckboxState(item, true); // | model.updateCheckboxState(item, true);
// //
this._setCheckboxState( storeItem, newState ); this._setCheckboxState( storeItem, newState );
if( this.checkboxStrict ) { //if( this.checkboxStrict ) { I don't need all this 1-1 stuff, only parent -> child (fox)
this._updateChildCheckbox( storeItem, newState ); this._updateChildCheckbox( storeItem, newState );
this._updateParentCheckbox( storeItem, newState ); //this._updateParentCheckbox( storeItem, newState );
} //}
}, },
setAllChecked: function(checked) { setAllChecked: function(checked) {
var items = this.store._arrayOfAllItems; var items = this.store._arrayOfAllItems;
@ -189,6 +190,7 @@ dojo.declare( "lib.CheckBoxStoreModel", dijit.tree.TreeStoreModel,
// newState: // newState:
// The new state of the checkbox: true or false // The new state of the checkbox: true or false
// //
if( this.mayHaveChildren( parentItem )) { if( this.mayHaveChildren( parentItem )) {
this.getChildren( parentItem, dojo.hitch( this, this.getChildren( parentItem, dojo.hitch( this,
function( children ) { function( children ) {