기존에 기본제공되는 search input 을 serverside로 검색 할 때는 input 인자 값 받아서 django에서 필터링했다.
이번에는 컬럼별로 필터링 해야 한다.
FixedHeader에서, column filtering을 해야 한다.
When displaying tables with a particularly large amount of data shown on each page,
it can be useful to have the table's header and / or footer
fixed to the top or bottom of the scrolling window.
This lets your users quickly determine what each column refers to rather than needing to scroll back to the top of the table.
$('#example tfoot th').each( function () {
var title = $('#example thead th').eq( $(this).index() ).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
$( '#example tfoot input' ).on( 'keyup change clear', function () {
//우선 이벤트까진 정상 발생한다.
//debugger
if ( test_table.search() !== this.value && this.value.length>0) {
search_result = test_table.search( this.value );
search_result.draw();
}
} );
-> 똑같은 검색기능을 적용해도, serverside로 하면 안됨. 클라이언트 사이드는 잘 된다.
update in 7.17
-> 중요) 서버사이드 렌더링 할 때 search().draw()로 하면, 클라이언트 사이드 렌더링 아님. 서버사이드로 col[search][val] attribute 포함해서, 1번 더 서버에 보냄.
서버단에서 filter() 등으로 직접 노가다를 안 할 뿐이지, serverside가 아닌게 아님...-ㅁ-
https://datatables.net/extensions/colreorder/examples/initialisation/col_filter.html
http://live.datatables.net/tobekuxu/1/edit