我在网格上有一个带有过滤器的 jqgrid 表。 显示用户选择的单选按钮。代码如下。
<ul id="cr_statusList" style="display:none;width:250px; z-index:1000">
<li>
<div id="fledDiv" style="width:100%;padding: 5px!important;" >
<input type="radio" id="fledRadioAll" name="fledRadio" checked="checked" value=""/><label for="fledRadioAll" style="width:17%;display:inline;">All</label>
<input type="radio" id="fledRadioY" name="fledRadio" value="Y"/><label for="fledRadioY" style="width:33%;display:inline;">Filed</label>
<input type="radio" id="fledRadioN" name="fledRadio" value="N"/><label for="fledRadioN" style="width:40%;display:inline;">Not Filed</label>
</div>
</li>
<li>
<div id="qarDiv" style="width:100%;padding: 5px!important;" >
<input type="radio" id="qaRadioAll" name="qaRadio" checked value=""/><label for="qaRadioAll" style="width:17%;display:inline;">All</label>
<input type="radio" id="qaRadioY" name="qaRadio" value="Y"/><label for="qaRadioY" style="width:33%;display:inline;">Qar</label>
<input type="radio" id="qaRadioN" name="qaRadio" value="N"/><label for="qaRadioN" style="width:40%;display:inline;">Not Qar</label>
</div>
</li>
</ul>
在 jqgrid 中,列以这种方式关联:
{name:'filed',index:'filedStr',label: 'Status', formatter:crFormatters.filedStatus, align:'center', width:90, searchoptions:{sopt:['eq'],
dataInit: taxJQGridUtils.buildMenuFilter(grid,
{menu:$("#cr_statusList"), createMenu:true,
widgetManagerOptions : {position:{my:"right top", at:"right bottom", collision: "none none"},
bindToFilter:$("input[name='fledRadio']"),
buttonOptions:{icons:{secondary: "ui-icon-triangle-1-s" }}}})}},
{name: 'qaStr', index:'qaStr', hidden:true, searchoptions:{sopt:['eq'],
dataInit: taxJQGridUtils.bindFilter(grid, {filter:$("input[name='qaRadio']")})}},
现在,我必须在网格外使用自定义过滤器,将 status 和 qar 作为两个单独的字段。 在 bindEvents:function(0){} 中,我设置的值如下 $("input[name='fledRadio']").filter('[value="' + fillStatus + '"]').prop('checked', false); $("input[name='qaRadio']").filter('[value="' + qaStatus + '"]').prop('checked', false);
但该值未设置为网格或过滤。 我试过 searchHidden: true - 没有帮助 在这种情况下如何将值设置到jqgrid工具栏并过滤网格。