1

我有一个带有列表复选框的网格

    <div height="200px">
<grid id ="actListBox" model="@bind(vm.actions)" >
<template name="model">
<row style=" width:200px !important; ">
    <cell rowspan="5" align="left" >
      <checkbox style="height: 70px; width:1000px; overflow: auto;   margin-left:10px;" 
      label="${each.action_name}" id ="${each.actionid}" value ="${each.actionid}"  />
     </cell>
</row>
</template>
</grid>
<span>
<checkbox label="Check all" value ="checkall" id="chkAll"/>
</span>
</div>

现在我想获得复选框的所有价值,但无论如何我都找不到请帮助我谢谢大家

4

1 回答 1

1

您可以在作曲家中通过迭代操作来检查 Id:

@Command
public void checkedIds(final Event e){
    final StringBuilder builder = new StringBuilder("Checked Ids: ");
    for (final Action action : actions) {
        if (action.getChecked()) {
            builder.append(action.getId()).append(' ');
        }
    }
    Messagebox.show(builder.toString());      
}

我更新了ZK fiddle

于 2013-08-14T08:10:18.483 回答