@@ -26,54 +26,42 @@ define([
26
26
27
27
if ( type !== this . previousType ) {
28
28
this . previousType = type ;
29
-
30
- if ( type === 'radio' ) {
31
- this . clearValues ( ) ;
32
- }
29
+ this . processSelections ( type === 'radio' ) ;
33
30
}
34
31
35
- this . toggleCheckbox ( type === 'radio' ) ;
36
-
37
32
this . _super ( ) ;
38
33
} ,
39
34
40
35
/**
41
- * Toggle 'User Defined' checkbox in selections
42
- * @param {Boolean } visibility
36
+ * Toggle 'User Defined' column and clears values
37
+ * @param {Boolean } isRadio
43
38
*/
44
- toggleCheckbox : function ( visibility ) {
45
- var records = registry . get ( this . retrieveParentName ( this . parentContainer ) + '.' + this . selections ) ;
39
+ processSelections : function ( isRadio ) {
40
+ var records = registry . get ( this . retrieveParentName ( this . parentContainer ) + '.' + this . selections ) ,
41
+ checkedFound = false ;
46
42
47
43
records . elems . each ( function ( record ) {
48
44
record . elems . filter ( function ( comp ) {
49
- return comp . index === this . targetCheckbox ;
45
+ return comp . index === this . userDefinedIndex ;
50
46
} , this ) . each ( function ( comp ) {
51
- comp . visible ( visibility ) ;
47
+ comp . visible ( isRadio ) ;
52
48
} ) ;
53
- } , this ) ;
54
- } ,
55
49
56
- /**
57
- * Clears values in components like this.
58
- */
59
- clearValues : function ( ) {
60
- var records = registry . get ( this . retrieveParentName ( this . parentContainer ) + '.' + this . selections ) ,
61
- checkedFound = false ;
50
+ if ( isRadio ) {
51
+ record . elems . filter ( function ( comp ) {
52
+ return comp . index === this . isDefaultIndex ;
53
+ } , this ) . each ( function ( comp ) {
54
+ if ( comp . checked ( ) ) {
55
+ if ( checkedFound ) {
56
+ comp . clearing = true ;
57
+ comp . clear ( ) ;
58
+ comp . clearing = false ;
59
+ }
62
60
63
- records . elems . each ( function ( record ) {
64
- record . elems . filter ( function ( comp ) {
65
- return comp . index === this . targetIndex ;
66
- } , this ) . each ( function ( comp ) {
67
- if ( comp . checked ( ) ) {
68
- if ( checkedFound ) {
69
- comp . clearing = true ;
70
- comp . clear ( ) ;
71
- comp . clearing = false ;
61
+ checkedFound = true ;
72
62
}
73
-
74
- checkedFound = true ;
75
- }
76
- } ) ;
63
+ } ) ;
64
+ }
77
65
} , this ) ;
78
66
} ,
79
67
0 commit comments