|
|
@@ -212,30 +212,32 @@
|
|
|
|
|
|
CGFloat eWidth = width + kfCommandNodeSwitchLeftPadding + kfCommandNodeSwitchRightPadding;
|
|
|
_constraintBtnOnWidth.constant = eWidth;
|
|
|
-
|
|
|
-
|
|
|
- CmdClsValueModel *cmdclsValueOn = _subItem.cmdclsValueList[0];
|
|
|
- CmdClsValueModel *cmdclsValueOff = _subItem.cmdclsValueList[1];
|
|
|
-
|
|
|
- //default setting
|
|
|
- _subItem.cmdclsValue = _subItem.cmdclsValue && ![_subItem.cmdclsValue isEmptyString] ? _subItem.cmdclsValue : cmdclsValueOn.cmdclsValue;
|
|
|
-
|
|
|
- [_btnOn setTitle:cmdclsValueOn.cmdclsValueMsg forState:UIControlStateNormal];
|
|
|
- [_btnOff setTitle:cmdclsValueOff.cmdclsValueMsg forState:UIControlStateNormal];
|
|
|
-
|
|
|
- if (_nodeEnable) {
|
|
|
- if ([_subItem.cmdclsValue isEqualToString:cmdclsValueOn.cmdclsValue]) {
|
|
|
- [self btnOnTouched:nil];
|
|
|
+ NSLog(@"SubItem : %@", _subItem.cmdclsValueList);
|
|
|
+ if (_subItem.cmdclsValueList.count) {
|
|
|
+ CmdClsValueModel *cmdclsValueOn = _subItem.cmdclsValueList[0];
|
|
|
+ CmdClsValueModel *cmdclsValueOff = _subItem.cmdclsValueList[1];
|
|
|
+
|
|
|
+ //default setting
|
|
|
+ _subItem.cmdclsValue = _subItem.cmdclsValue && ![_subItem.cmdclsValue isEmptyString] ? _subItem.cmdclsValue : cmdclsValueOn.cmdclsValue;
|
|
|
+
|
|
|
+ [_btnOn setTitle:cmdclsValueOn.cmdclsValueMsg forState:UIControlStateNormal];
|
|
|
+ [_btnOff setTitle:cmdclsValueOff.cmdclsValueMsg forState:UIControlStateNormal];
|
|
|
+
|
|
|
+ if (_nodeEnable) {
|
|
|
+ if ([_subItem.cmdclsValue isEqualToString:cmdclsValueOn.cmdclsValue]) {
|
|
|
+ [self btnOnTouched:nil];
|
|
|
+ } else {
|
|
|
+ [self btnOffTouched:nil];
|
|
|
+ }
|
|
|
} else {
|
|
|
- [self btnOffTouched:nil];
|
|
|
+ _btnOn.selected = NO;
|
|
|
+ _btnOff.selected = NO;
|
|
|
+
|
|
|
+ [[JDFacade facade] setRadioButtonStatus:@NO object:_subItem.cmdclsValueList[0]];
|
|
|
+ [[JDFacade facade] setRadioButtonStatus:@NO object:_subItem.cmdclsValueList[1]];
|
|
|
}
|
|
|
- } else {
|
|
|
- _btnOn.selected = NO;
|
|
|
- _btnOff.selected = NO;
|
|
|
-
|
|
|
- [[JDFacade facade] setRadioButtonStatus:@NO object:_subItem.cmdclsValueList[0]];
|
|
|
- [[JDFacade facade] setRadioButtonStatus:@NO object:_subItem.cmdclsValueList[1]];
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (IBAction)btnOnTouched:(id)sender {
|