当用户单击按钮时更改 litstbox 项目的选择状态 (ZK 3.6.4)
我正在使用 ZK 3.6.4 进行一个项目。但我有一个问题,当用户单击同一列表框(同一列表项)内的按钮时,我想更改 litstbox 项的选择状态,因为我想知道 selectedItem。我正在阅读 zk 文档,我可以做到这一点,但是使用 Zk 版本 5.0.5+(nonselectableTags)。但我无法更改此版本的项目规则。那么,有办法用 3.6.4 来模拟这种行为吗?或者你能给我什么样的建议来做到这一点?我真的很感谢你的帮助。
这是我的代码。
<listbox
id="listDocAcads" mold="paging" pageSize="2"
model="@{win$composer.academicCollections}"
selectedItem="@{controller.docEntAcad}" >
<listhead>
<listheader
width="30%" label="Name" />
<listheader
width="15%" label="amount" />
<listheader
width="15%" label=" delivered?" />
<listheader
width="20%" label="Importance" />
<listheader
width="20%" label="Document" />
</listhead>
<listitem
self="@{each='docAcad'}" value="docAcad"
style="border:none;">
<listcell
label="@{docAcad.colleByProcess.oDocument.name}" />
<listcell
label="@{docAcad.colleByProcess.amount}" />
<listcell>
<spinner
width="60%" value="@{docAcad.amount}" />
</listcell>
<listcell
label="@{docAcad.colleByProcess.oImportance.name}" />
<listcell ><button id="btnUploadDocument" label="Upload"/> </listcell>
</listitem>
</listbox>
I'm working in a project with ZK 3.6.4. but I have a problem, I want to change the selection state of the litstbox item when a user clicks on a button inside the same listbox ( same listitem)., because I want to know the selectedItem. I was reading zk documentation and I can do it , but with Zk version 5.0.5+ (nonselectableTags). But I cannot change for this version for project rules. So, there are a way to emulate this behavior with 3.6.4? or what kind of advices can you give me to do this? I really appreciate your help.
Here the code that I have.
<listbox
id="listDocAcads" mold="paging" pageSize="2"
model="@{win$composer.academicCollections}"
selectedItem="@{controller.docEntAcad}" >
<listhead>
<listheader
width="30%" label="Name" />
<listheader
width="15%" label="amount" />
<listheader
width="15%" label=" delivered?" />
<listheader
width="20%" label="Importance" />
<listheader
width="20%" label="Document" />
</listhead>
<listitem
self="@{each='docAcad'}" value="docAcad"
style="border:none;">
<listcell
label="@{docAcad.colleByProcess.oDocument.name}" />
<listcell
label="@{docAcad.colleByProcess.amount}" />
<listcell>
<spinner
width="60%" value="@{docAcad.amount}" />
</listcell>
<listcell
label="@{docAcad.colleByProcess.oImportance.name}" />
<listcell ><button id="btnUploadDocument" label="Upload"/> </listcell>
</listitem>
</listbox>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你想忽略按钮和输入,你可以这样做。
nonselectableTags="按钮,输入"。
nonselectableTags 的值应该是用逗号分隔的 HTML 标签。
希望这有帮助!
if you want to ignore button and input's u can do this.
nonselectableTags="button, input".
the values to nonselectableTags should be HTML tags separated by comma.
Hope this helps!