我有這段代碼有一個通過Footable的選擇字段過濾器。它可以工作,但是它會比所需要的更多的結果。例如:「國家期刊文章」選項用「國家期刊文章」和「國際期刊文章」過濾行。我怎樣才能讓它更精確?謝謝。Footable精細過濾
jQuery(function() {
jQuery('#projectos').footable().bind('footable_filtering', function (e) {
var selected = jQuery('.filter-status').find(':selected').text();
if (selected && selected.length > 0) {
e.filter += (e.filter && e.filter.length > 0) ? ' ' + selected : selected;
e.clear = !e.filter;
}
});
jQuery('.clear-filter').click(function (e) {
e.preventDefault();
jQuery('.filter-status').val('');
jQuery('#projectos').trigger('footable_clear_filter');
});
jQuery('.filter-status').change(function (e) {
e.preventDefault();
jQuery('#projectos').trigger('footable_filter', {filter: jQuery('#filter').val()});
});
});
,您可以包括JSFiddle還是Plunk? – Jeff
這是住在這裏:http://cei.iscte-iul.pt/publicacoes/publicacoes-de-investigadores/ – AnaRita
我在我的答案中提供了一個簡單的普拉克。我發現,當我使用JSFiddle或Plunk創建一個簡單的示例時,我可以更快地得到答案。 (我個人更喜歡使用plunk,但都很好)你提供的實例演示了你描述的問題,但它也有很多其他代碼,我不得不通過它們來查看你的Footable代碼。 – Jeff