繁体   English   中英

根据Angular弹出窗口中的条件禁用单选按钮?

[英]Disable radio button based on condition in Angular popup?

如果某些情况为真,我试图禁用单选按钮。 这是打开我的弹出窗口的链接:

<a style="text-decoration: underline; text-align: left; white-space: pre-wrap;" class="btn btn-flat btn-small" data-toggle="modal" data-target="#CancelContinuecopytogroupPopupModel" (click)="passReqIdforcopytogroup(requestDetail,groupData,solutionData,)"><b>Copy To another Group</b></a>

这是显示此单选按钮的弹出代码(只是添加了单选输入,而不是整个弹出源代码)

<label for="{{radio1.id}}" class="radio" (click)="radioSelected(radio1.label)">
 <input type="radio" id="{{radio1.id}}" [disabled]="solutionData.ReqGroupName == 'some'" name="optionsRadio41" value="{{radio1.value}}" required="" checked="{{radio1.checked}}">
 <i class="skin"></i>
<span>Copy Within this solution</span>
</label>

这是我要通过的功能,将详细信息传递给弹出窗口以进行显示:

passReqIdforcopytogroup(nxRequestId,solutionData,groupData){
        this.ReqId = RequestId;
        this.ReqGroupId = groupData;
        this.GroupRequestDesc = groupData;
        this.SolutionId = solutionData.SolutionId;
        this.ReqGroupName = solutionData.ReqGroupName;
    }

这给了我undefined ,我不知道为什么。 在上面的函数中,我获取了一个值,将其传递给它以禁用单选按钮。 谁能帮助我? 谢谢!

passReqIdforcopytogroup(nxRequestId,solutionData,groupData){
        this.ReqId = RequestId;
        this.ReqGroupId = groupData;
        this.GroupRequestDesc = groupData;
        this.SolutionId = solutionData.SolutionId;
        this.ReqGroupName = solutionData.ReqGroupName;
    }

<label for="{{radio1.id}}" class="radio" (click)="radioSelected(radio1.label)">
 <input type="radio" id="{{radio1.id}}" [disabled]="ReqGroupName == 'some'" name="optionsRadio41" value="{{radio1.value}}" required="" checked="{{radio1.checked}}">
 <i class="skin"></i>
<span>Copy Within this solution</span>
</label>

<a style="text-decoration: underline; text-align: left; white-space: pre-wrap;" class="btn btn-flat btn-small" data-toggle="modal" data-target="#CancelContinuecopytogroupPopupModel" (click)="passReqIdforcopytogroup(requestDetail,solutionData,groupData)"><b>Copy To another Group</b></a>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM