Wie neu Initialisieren Datatable Ajax

Was Ich Brauche

*Bei Ajax geladen wird datierenden ist reintailized.

Ajax-Aufruf-code:

   if ($('#teamTable').size() > 0)
    {

        $('#teamTable').dataTable({
            "sPaginationType": "bootstrap"
        });
    }

      $("#save_team").click(function() {
            $.ajax({
            type: "POST",
            url: "asana_team.php",
            data: { people_name: $('#e2').val(), team_name:$('#teamname').val() },
            beforeSend : function(){
                $("#team_table").remove();
                $("#team_table_div").append("<center id=\"loading\" style=\"margin-top:25%;margin-bottom:25%\"><img src='../common/images/ajax-loader.gif' /></center>");
            },
            contentType: "application/x-www-form-urlencoded"
            }).done(function(data) {
                $("#loading").remove();
                $('#team_table_div').append(data);
                $('#teamTable').dataTable({
                    "sPaginationType": "bootstrap"
                });                    
            });
        });

* arbeiten gut, aber ich reintializing Paginierung in datatable keine datierenden geladen wird.

  • ich habe diesen code reinitailize Tabelle.

     function callBack()
     {
     var call= $('#teamTable');
    
    call.dataTable({
     "sPaginationType": "bootstrap",
     "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
     "oLanguage": {
     "sLengthMenu": "_MENU_ records per page"
     } });
    }
    $(document).ready(function() {
    callBack();
    });
  • versuchen Sie in der success Funktion
  • ich habe versucht, aber keine Lösung Tabelle ist nicht rintialized
InformationsquelleAutor user3703097 | 2014-06-27
Schreibe einen Kommentar