我试图根据下拉选择隐藏几列。尽管所有的可能性,但没有任何工作对我来说。这是我的来源,
我的fooTable HTML,
<table class="footable table" id="M-AMA-AUT-401-00NP_fooTable" data-sort="false" >
<thead>
<tr class="fooTable-Header-Color">
<th id="th_Omselement">OMS Element</th>
<th id="th_OmsDomain">OMS Domain</th>
<th data-sort-ignore="true" data-hide="phone">Priority</th>
<th data-sort-ignore="true" data-hide="phone">Finding</th>
<th data-sort-ignore="true" data-hide="phone">Comments</th>
<th data-sort-ignore="true" data-hide="phone">Finding type</th>
</tr>
</thead>
</table>
我的代码,
if($typeSelected=='OMS'){
$('.footable').data('footable').reset();
$('#th_Omselement').data("hide", "");
$('#th_OmsDomain').data("hide", "");
$('.footable').data('footable').footable();
/*$("#th_Omselement").show();
$("#th_OmsDomain").show();
$('#'+id+'_td_Omselement').show();
$('#'+id+'_td_OmsDomain').show();*/
}
else {
$('.footable').data('footable').reset();
$('#th_Omselement').data("hide", "all");
$('#th_OmsDomain').data("hide", "all");
$('.footable').data('footable').redraw();
/* $("#th_Omselement").hide();
$("#th_OmsDomain").hide();
$('#'+id+'_td_Omselement').hide();
$('#'+id+'_td_OmsDomain').hide();*/
}