2013-10-23 7 views
0
내가, 내가 테이블에 새 행을 추가하려면 몇 행이 데이터 테이블을 원하는 한

: 나는 데이터 테이블을 초기화하기 때 추가catch되지 않은 형식 오류 : 개체 [개체 개체]있는 방법이 없습니다 'fnStandingRedraw'

var oTable = $('#StudentsTable').dataTable(); 
    Table2.fnStandingRedraw(); 

:

submitHandler: function(form) { 
      var $modal = $('#ajax-modal'); 
      $modal.modal('loading'); 
      $(form).ajaxSubmit({ 
       dataType: 'json', 
       success: function(result) { 
        if (result.Success) { 
         if (result.Data.Action == "add") { 
          var oTable2 = $('#StudentsTable').dataTable(); 
/*=>here is Call redraw */ oTable2.fnStandingRedraw(); 
         } 
여기

그것은 나에게 오류를 제공합니다 :

  "bProcessing": true, 
      "bServerSide": true, 
      "bDestroy": true, 
      "fnFilter": true, 
      'bLengthChange': true, 
      'bPaginate': true, 
      'bStandingRedraw': true, 

아약스 후 나는 테이블을 redrow 할 제출을잡히지 않은 TypeError : Object [object Object]에 'fnStandingRedraw'메서드가 없습니다.

몇 가지 제안 사항이 있습니까?

+0

기본 API 메소드가 아닙니다. 이 참조 페이지는 datatables를 사용할 때 생명의 은인입니다 : http://datatables.net/ref – adamb

답변

2

fnStandingRedraw 플러그인을 잊어 버렸습니다. Datatables의 스크립트 파일 바로 뒤에 추가하십시오.

스크립트 상단에 스 니펫을 복사하여 붙여 넣을 수도 있지만 별도의 파일에 배치하는 것이 더 체계적이며 재사용 가능할 수도 있습니다. 또는 압축되지 않은 Datatables 소스 파일의 끝에이 스 니펫을 연결하여이를 모두 축소 할 수 있으므로 Datatables 스크립트가 포함될 때 항상 사용할 수 있습니다.