我为我的表构建了过滤器功能,因此我可以显示所需的信息。通过单击按钮(超链接)之一,将打开一个具有所有类别和选项的模态。现在,我只能调用模式,并且第一个类别将首先显示。我要做的是单击一个按钮(链接),然后将显示该按钮(链接)的类别。我不知道如何实现这一部分。我没有太多的Java脚本经验来解决它。是否可以直接将标签直接调用ID?或者单击按钮(链接)时可以调用函数,以便将某些内容传递给模态以调用正确的类别吗?也许有另一种/更简单的方法...
buttons to display filter categories
categories in modal 2
<div class="fg-lg-2 fg-md-2 fg-sm-2">
<label for="department">${message:department}</label>
<br/>
<a
class="btn btn-primary btn-md page-scroll wow fadeInUp m-t-3"
data-toggle="modal"
title="${message:parameterForm}"
href="#filterModal">
${message:adddepartments}
</a>
</div>
<t:modal.layout
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
xmlns:p="tapestry:parameter"
modalid="filterModal"
inheritedClass="${class.simpleName}">
<div class="nav">
<ul t:id="tabs" t:type="any" class="nav nav-tabs nav-justified">
<li class="card nav-item visible"><a class="active show" data-toggle="tab" href="#TabA">A</a></li>
<li class="card nav-item visible"><a data-toggle="tab" href="#TabB">B</a></li>
<li class="card nav-item visible"><a data-toggle="tab" href="#TabC">C</a></li>
</ul>
</div>
<br/>
<t:form t:id="form" validate="filtered" class="form-horizontal well">
<div class="tab-content">
<div id="A" class="tab-pane fade in form-group">
<div class="col-sm-3">...
</div>
</div>
<div id="TabB" class="tab-pane fade in form-group">
<div class="col-sm-3">...
</div>
</div>
<div id="TabActivity" class="tab-pane fade in form-group">
<div class="col-sm-3">...
</div>
</div>
<div id="TabC" class="tab-pane fade in form-group">
<div class="col-sm-3">...
</div>
</div>
</div>
<div
class="btn-group fullwidth"
role="group">
<button
class="btn btn-primary btn-md page-scroll wow fadeInUp halfwitdth"
type="submit">
${message:add}
</button>
<button
class="btn btn-primary btn-md page-scroll wow fadeInUp halfwitdth"
data-dismiss="modal"
aria-hidden="true">
${message:cancel}
</button>
</div>
</t:form>
</t:modal.layout>