Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35270

Refresh Table with Post and Ajax

$
0
0

Hi!
I try to refesh my table with ajax. With get all works fine, but if I use POST I can't change the values put to the ajax script. But I have to use POST, with get the URL is to long.
ajax.data() doesn't work. What is wrong with my code?

Here is my code:

table.ajax.url(url+"?aja=1&wch=tbl&").load();

var table=$('#showsTable').DataTable({
        "language": {
                    "sEmptyTable":      "Keine Daten in der Tabelle vorhanden",
                    "sInfo":            "_START_ bis _END_ von _TOTAL_ Einträgen",
                    "sInfoEmpty":       "0 bis 0 von 0 Einträgen",
                    "sInfoFiltered":    "(gefiltert von _MAX_ Einträgen)",
                    "sInfoPostFix":     "",
                    "sInfoThousands":   ".",
                    "sLengthMenu":      "_MENU_ Einträge anzeigen",
                    "sLoadingRecords":  "Wird geladen...",
                    "sProcessing":      "Bitte warten...",
                    "sSearch":          "Suchen",
                    "sZeroRecords":     "Keine Einträge vorhanden.",
                    "oPaginate": {
                        "sFirst":       "Erste",
                        "sPrevious":    "Zurück",
                        "sNext":        "Nächste",
                        "sLast":        "Letzte"
                    },
                    "oAria": {
                        "sSortAscending":  ": aktivieren, um Spalte aufsteigend zu sortieren",
                        "sSortDescending": ": aktivieren, um Spalte absteigend zu sortieren"
                    }
                },
        "order": [ [1,'asc'], [0,'asc'] ],
        "ajax": {   "url":"http://localhost/index.php?aja=1&wch=tbl",
                    "dataSrc": "",
                    "type":"POST",
                    "data":values
                },
        "columns": [
            { "data": "n" },
            { "data": "s" },
            { "data": "e" },
            { "data": "t" },
            { "data": "g" },
            { "data": "f" }
        ],
        "lengthMenu": [ [10, 25, 50, 100, 200, -1], [10, 25, 50, 100, 200, "Alle"] ],
        "pageLength": 25,
        "searching":true,
        "columnDefs": [ { "orderable": false, "targets": 2 },
                        { "orderable": false, "targets": 5 }]

    } );

Viewing all articles
Browse latest Browse all 35270

Trending Articles