2016-11-25 30 views
1

我想使用MongoDB數據庫過濾Meteor中的HTML表格。Meteorjs使用Jquery的HTML表格過濾器

我有一個模板來顯示(每個)我在HTML表中的所有遊樂設施。

我想實現一個jQuery選擇過濾器來過濾表。

<template name="rides"> 
<div class="table-responsive"> 
<table id="table_format" class="table table-striped"> 
<thead> 
<tr> 
<th>Abfahrtsort</th> 
<th>Zielort</th> 
<th>Gesucht werden</th> 
<th>Datum</th> 
<th>Plätze</th> 
<th>Kommentar</th> 
</tr> 
</thead> 

<tbody> 
{{#each rides}} 
<tr> 

<td>{{departure}}</td> 
<td>{{destination}}</td> 
<td>{{searching}}</td> 
<td>{{dateandtime}}</td> 
<td>{{seats}}</td> 
<td>{{comment}}</td> 
<td>{{#if currentUser}}<button class="edit">Bearbeiten</button>{{/if}}</td> 

</tr> 
{{/each}} 
</tbody> 
</table> 
</div> 

<script src="jquery-1.11.3.min.js"></script> 
<script src="ddtf.js"> </script> 
<script> 
jQuery('#table_format').ddTableFilter(); 
</script>` 

它不會在表格中顯示我的數據,也不會顯示過濾器。

回答

0

嘗試在jQuery的文件準備好方法

$(document).ready(function(){ 

    jQuery('#table_format').ddTableFilter(); 

}); 
+0

我忘了是方法使用ddTableFilter(),但它不工作也不 – artcore