Multi-level rowGroup

Multi-level rowGroup

agustyanagustyan Posts: 2Questions: 0Answers: 0

Hi Need some help, but before I started I'm sorry if my english was not good enough

I try to make rowgroup using datatables then it works well with single level rowgroup, but when it come to multi level rowgroup problem occurs. Row group header not display properly.

I'm using ajax and jquery

here is my json file

{
    "draw": "1",
    "data": [
        [
            "Pola Pemasaran Pasif\r\n",
            "Sosialisasi Tambah daya ke Konsumen 2 Kali seminggu",
            "Sosialisasi 8 Kali dalam bulan Mei 2021",
            "utama",
            "controllable",
            "100.00%",
            "some button here"
        ],
        [
            "Pola Pemasaran Pasif\r\n",
            "Menghubungi Pelanggan untuk tambah daya (1000 Plg/Minggu)",
            "Menghubungi pelanggan 4200 Plg / Mei 2021",
            "utama",
            "controllable",
            "105.00%",
            "some button here"
        ]
    ]
}

here is my jquery code

$.ajax({
            url: "<?php echo site_url('admin/kpi/detail/') ?>" + id,
            type: "GET",
            dataType: "JSON",
            success: function(data) {

                table2 = $('#datatable-riskkpi').DataTable({

                    "processing": true, //Feature control the processing indicator.
                    "serverSide": true, //Feature control DataTables' server-side processing mode.
                    "destroy": true,
                    "searching": false,
                    "order": [
                        [0, 'asc'],
                        [1, 'asc']
                    ],
                    "paging": false,

                    // Load data for the table's content from an Ajax source
                    "ajax": {
                        "url": "<?php echo site_url('admin/risk/list') ?>",
                        "type": "POST"
                        //"dataSrc": ""
                    },
                    rowGroup: {
                        dataSrc: [0, 1]
                    },
                    columnDefs: [{
                        targets: [1, 0],
                        visible: false
                    }]
                });

                $('#text_risk_kpi').html(data.kpi);
                $('#modal-risk').modal('show');
                $('.modal-title').text('Risk per KPI');
            },
            error: function(jqXHR, textStatus, errorThrown) {
                alert('Error get data from ajax');
            }
        });

here is picture of my broken table:

Any comments will be helpfull

Regards

Replies

Sign In or Register to comment.