我有一个简单的 HTML 复选框列表,如下所示:
<input type="button" class="check" value="check all" onclick="foo()"/>
<input type="checkbox" class="chk" value="1"/> Checkbox 1
<input type="checkbox" class="chk" value="2"/> Checkbox 2
<input type="checkbox" class="chk" value="3"/> Checkbox 3
单击“全选”按钮时,我想编写一个ExtJS 函数,该函数选择所有复选框(并再次切换它会取消选择所有复选框)并返回数组中的选定值。我已经使用 jQuery 完成了它,但需要使用我非常新的 ExtJS 来编写它。