아래 코드는 정상적으로 작동하고 모든 데이터를 가져옵니다. 난 datatable (sample_container)에 몇 가지 필터 문자열을 삽입하고 싶습니다. 따라서 주어진 sample_app의 경우, 페이지가로드 될 때 sample_container 데이터 테이블에 대한 일부 필터 문자열 (filter1, filter2)을 사용하여 자동으로 필터링하고 싶습니다. 어떤 아이디어?Jquery datatables 문자열 필터
$("#sample_container").html("<h2>Sample libs</h2>");
$.ajax({
type: "GET",
url: "some_url",
data: some_data,
dataType: 'jsonp',
crossDomain: true,
async: false,
success: function(response) {
$("#sample_container").html("<h2>Sample Libraries</h2>");
html = "<table class='datatable'>";
blah blah
}
html += "</table>";
$("#sample_container").append(html);
$("#sample_container .datatable").dataTable({ "bPaginate": false,
"bAutoWidth": false,
"bFilter": false,
"bInfo": false
}).columnFilter({ sPlaceHolder: "head:after",
aoColumns: [ { type: "text" },
{ type: "text" },
{ type: "text" }
]
});
},
});
{% if sample_app %}
<h1>{{ sample_app.id }} - {{ sample_app.name }}</h1>
<br/>
blah blah...
{% endif %}