표에 데이터가 있어도 데이터 표에 검색 결과가 표시되지 않습니다. jquery datatable 플러그인을 사용하고 있습니다. 일부 열의 데이터를 동적으로 채우고 나중에 사용자가 일부 데이터를 입력 할 수 있도록 일부 열을 만드는 중입니다.동적으로 채워진 표가있는 jquery datatables에서 검색이 작동하지 않습니다.
그때 난 당신이 어딘가에 마크 업에 문제가 생각 /스타일
<script src="media/js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="media/js/jquery.dataTables.js"></script>
<link href="media/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="extensions/Plugins/integration/bootstrap/3/dataTables.bootstrap.js"></script>
<link rel="stylesheet" href="css/bootstrap-multiselect.css" type="text/css">
<script type="text/javascript" src="js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<script>
$(document).ready(function() {
$('#dbResultsTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers" ,
"paging": true,
"ordering" : false,
"scrollY":false,
"autoWidth": true,
"info": true ,
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"dom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>'
}
);
$('.companyNamesClass').multiselect({
enableFiltering: true
}),
$('#dbResultsTable').on('draw.dt', function() {
$('.companyNamesClass').multiselect({
enableFiltering: true,
});
});
});
</script>
<!--- jsp page code here --->
<table width="1698" cellspacing="0" class="elements" id="dbResultsTable" >
<thead>
<tr bgcolor="#33FFFF">
<th>Student</th>
<th>BranchName</th>
<th>Year</th>
<th>Company</th>
<th>Pkg</th>
</thead>
<tbody>
<c:forEach var="indexMap" items="${requestScope.studentMap}">
<tr><td><input type="textbox" value="${indexMap.key}"></td>
<td><input type="texbox" value="${resultMap.value}"></td>
<td>2010</td>
<td>
<select name="compnayNames[]" class="companyNamesClass" multiple="multiple">
<option value="Apple">Apple</option>
<option value="Google">Goolge</option>
<option value="Tata">Tata</option>
<option value="IBM">IBM</option>
<option value="Other">Others</option>
</select>
</td>
<td><input type="textbox"></td>
</tr>
</c:forEach>
</tbody>
아무도 실마리가 없습니다. 열 검색에 값을 추가 한 후에도 검색이 작동하지 않습니다. – harpal18
다소 혼란 스럽습니다. 데이터를 동적으로 삽입하는 위치는 JSP로 생성 된 테이블처럼 보입니다./data가 dataTables 검색에서 작동하지 않습니까? – davidkonrad
@ davidkonrad, 예, JSP 페이지에서 테이블을 만들뿐 아니라 데이터 테이블 플러그인을 호출하여 데이터 테이블 기능을 내 테이블에서 활성화합니다. – harpal18