JQuery 데이터 테이블을 파괴하는 데 문제가 있습니다. 내가 그것을 파괴하려고 곳jQuery 데이터 테이블을 파괴 할 수 없습니다.
다음$(document).ready(function() {
var table = $(".dynamic-wide-table").DataTable({
"aaSorting": [],
"scrollX": true,
"scrollY": 530,
"scrollCollapse": true,
"lengthMenu": [
[100, 400, 1000, 5000, -1],
[100, 400, 1000, 5000, "All"]
],
"retrieve": true
});
});
은 다음과 같습니다 :
는Uncaught TypeError: table.destroy is not a function
Uncaught TypeError: table[0].destroy is not a function
은 사람이 무엇을 알고 있습니까 : 여기
$(document).ready(function() { // Note that my page has two tables on it!
table.destroy();
table[0].destroy();
}); // Trying to delete both tables first, then just the first table
내 오류가 있습니다 내가 그것을 초기화 곳에있다
입니다 계속 해! 나는 매우 혼란 스럽다.
편집 : 여기
내가 table
을 CONSOLE.LOG 때 발생의 이미지입니다.
! https://jsfiddle.net/cmedina/7kfmyw6x/79/ – CMedina
광산은 클래스별로 선택되며 시작되고 별도의 파일로 파괴됩니다. 그것과 관련이있을 수 있습니까? – Nic
이 [답변] (http://stackoverflow.com/questions/38486062/retest-datatable-object-of-element/38486244)에서 설명한 것처럼 ID를 사용하여 dataTable 객체를 가져 와서 함수를 호출해야합니다. [ jsFiddle] (https://jsfiddle.net/63qhddxx/) –