Table render Info info.page and pagination one row one page

Table render Info info.page and pagination one row one page

sharkowolfsharkowolf Posts: 21Questions: 9Answers: 0

Dear Colleagues, Allan,

I ask you to suggest in the next question.

In a table with a number of simultaneously displayed lines, I try to display the current page number (which is essentially a line) in the table header.

I want to perform the mapping when rewriting the table.

It is interesting that render for fields works, but it is not possible to get the value of table.info. Please tell me how can I do this?

Here is my code:

 var table = $('#questions').DataTable( {
        dom: "Brtip",
    pagingType: "simple",
    pageLength: 1,
    paging:     true,
        ordering:   false,
        info:       false,
        ajax: "../../controllers/staff_300.php",
        columns: [
  //          {
  //              className:      'details-control',
  //              orderable:      false,
  //              data:           null,
  //              defaultContent: ''
  //          },
        {   
            "targets": 4,
            "render": function ( data, type, row, meta) {
                    return 'Вопрос номер '+data+' ';}, 
            data:   "quest_order"
        }, {
                data: null,
                render: function(data, type, row, meta) {
            var info = table.page.info();
            return '<progress value="'+info.page+'" max="'+info.pages+'"></progress>';
                }
               },
        ],
        order: [[0, 'asc']],
        select: false,
        buttons: [],
        rowCallback: function ( row, data, index ) {
                            $('td:first-child', row).attr('title', 'Click to edit'); 
                                editor.edit(row,'','');
                           },
    initComplete: function(settings, json){ 
            //var info = this.api().page.info();
            //alert('Total records', info.recordsTotal);
        }

    } );

Yours faithfully,
Andrey

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.