且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在选中复选框时选择列表框中的所有项目?

更新时间:2023-11-28 21:46:16

我认为你必须在这里循环.一次选择所有项目是一个非常具体(并且可能很少见)的用例,开箱即用地提供该功能是没有意义的.此外,无论如何,循环只是两行代码.

I think you have to loop here. Selecting all items at once is a pretty specific (and probably rare) use case where it simply makes no sense to offer that functionality out of the box. Furthermore, the loop will be just two lines of code anyway.