angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

Responsive DataTables - Column type causes issues

Open rnunez100 opened this issue 9 years ago • 2 comments

  • angular version: v1.5.0
  • angular-datatables version: v0.5.3

What's the problem?

I'm using the angular responsive DataTables. For some reason when I use the responsive.details.type 'Column', my Select Dropdown stops working. The dropdown will have the correct default value selected, but when I try to click the Dropdown nothing happens. I have select dropdowns in both the parent row and child row. If I remove the column type the parent row select dropdown will work correctly again, but the child select dropdown will not work. I've added type: false and both parent/child select dropdowns worked, but if I clicked on a sorting tab some of the child rows would show and other would not.

The reason I'm trying to use the column type is, because it removes the expand/collapse button which is what I want.

Here is some of my code:

                .withOption('responsive', {
                    details: {
                        renderer: function (api, rowIdx, columns) {
                            var data = $.map(columns, function(col, i) {
                                var title = col.title != '' ? '<label class="labelsz">' + col.title + '</label>' : '';
                                return col.hidden ? '<td>' + title + col.data + '</td>' : '';
                            }).join('');

                            return data ?
                            $compile(angular.element($('<table data-dtr-index="'+rowIdx+'"/>').append(data)))($scope) :
                            false;
                        },
                        type: 'column',
                        display: $.fn.dataTable.Responsive.display.childRowImmediate
                    }
                })

rnunez100 avatar Aug 17 '17 16:08 rnunez100

I think your answer lies in more in the DataTables forum than here.

l-lin avatar Aug 20 '17 14:08 l-lin

Fixed, changed the type : type:false

rnunez100 avatar Aug 25 '17 16:08 rnunez100