Multicheckbox无法点击(根本没有检查)
我想在网格单元格中渲染多个复选框。 我尝试了Forly Multicheckbox。但是,复选框甚至没有渲染。因此,我试图以这种方式进行操作,但是这样它根本没有被检查。 目前,我不希望在复选框上完成任何事件,我只希望它检查用户未检查。 to.labels 来自另一项服务。在.ts文件中,我有:
public ngOnInit{
console.log(this.to.labels) }
有人可以帮忙吗?
<div class="inline-div" *ngFor="let item of to.labels | keyvalue; let idx=index">
<input type="checkbox" id="custom-multicheckbox">
<label class="form-check-label" for="custom-multicheckbox">{{item.value.value}}</label>
</div>
标签就像一个数组,
0: { id:1, label:'P'}
1: {id:2, label:'R'}
我认为问题是复选框在网格上,因此网格单元格越来越活跃,而不是复选框。请建议如何在网格单元中激活复选框。
I wanted to render multiple checkbox in a grid cell.
I tried with formly multicheckbox. But with that, the checkboxes were not even rendering. So I tried to do it in this way, but in this way it's not being checked at all.
Right now, I don't want any event to be done on checkbox, I just want it to checkec unchecked by user. to.labels is coming from another service. In .ts file, I am having :
public ngOnInit{
console.log(this.to.labels) }
Can someone please help?
<div class="inline-div" *ngFor="let item of to.labels | keyvalue; let idx=index">
<input type="checkbox" id="custom-multicheckbox">
<label class="form-check-label" for="custom-multicheckbox">{{item.value.value}}</label>
</div>
to.labels is like an array
0: { id:1, label:'P'}
1: {id:2, label:'R'}
I think the problem is the checkboxes are on a grid, so the grid cell is getting active and not the checkbox. Please suggest how to activate checkbox in a grid cell.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么您使用item.value.value?而不是项目。
您可以这样尝试:
why you are using item.value.value? instead of item.value
you could try this way: