i am trying to create nested datatable, datatable contains datatable inside child row

i am trying to create nested datatable, datatable contains datatable inside child row

clashofkingsclashofkings Posts: 2Questions: 1Answers: 0

i am new to datatables , and i am confused how can i achieve datatable with row order and its rows has one child, which is also a datatable with row reorder , all tables also contain crud operations(add,update, delete). suggestion about any structural design also would be appreciated. if i am approaching it in wrong way.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin
    Answer ✓

    DataTables does not currently support a tree view style. You can have a child row which is controlled by row().child() but it is completely independent of the other child rows and the parent table (other than its position).

    Allan

  • clashofkingsclashofkings Posts: 2Questions: 1Answers: 0

    thank you very much Allan for your quick response, can you please tell me how can i make sure that row-reorder is applied on datatable, in my case i am initializing datatable with row re order, but when its rendered it has sorting-disabled class applied on that .

    below is code which i am using for initialization of databtable

    $(table).dataTable({
    
    
                    "pageLength": -1,
    
                    "language": {
                      "lengthMenu": " _MENU_ records"
                    },
                    "columnDefs": [{ // set default column settings
                      'orderable': false,
                      'targets': [0,1,2,3,4,5,6]
                    }, {
                      "searchable": false,
                      "targets": [0,1,2,3,4,5,6]
                    }, {
                      "targets": [6,3],
                      "visible": false
                    }],
    
                    "order": [
                      [3, "asc"]
                    ], // set first column as a default sort by asc
    
                    rowReorder: {dataSrc:3},
                    info: false,
                    paging: false,
                    searching: false,
                    retrieve: true,
                });
    
This discussion has been closed.