2017-12-25 5 views
0

View에 100 개의 편집 가능한 레코드가있는 DataTable이 있습니다. 기록을 편집하여 MVC Action에 게시 할 수 있습니다. DataTable을 파기하고 양식을 게시하면 양식 모음에 100 개의 모든 기록이 있습니다. 반면에, 내가 DataTable을 파괴하지 않고 submit을 클릭하면, 나는 처음 10 개의 레코드만을 얻습니다.면도날 양식이 MVC 작업에 DataTable의 모든 행을 게시하지 않습니까?

<script> 

    $(document).ready(function() { 

     var table = $('#tblEvents').DataTable(); 

     $("form").on('submit', function() { 
      // If I remove this I get only first 10 Records. 
      table.destroy(); 
     }); 
    }); 


</script> 
+0

은 https : // 유래

@using (Html.BeginForm("Edit", "Events", FormMethod.Post)) { @Html.AntiForgeryToken() <button type="submit"> Save </button> <table id="tblEvents"> <thead> <tr> // Header </tr> </thead> <tbody> // Records </tbody> </table> } 

스크립트 : 여기

내 코드입니다 .com/questions/13963732/datatables-and-jquery-post? rq = 1이 도움이 될 수 있습니다. –

답변

0

양식을 제출하기보다는 전체 페이지를 다시로드 아약스 호출을 사용하여 시도, 그것은 작동 할 수

관련 문제