Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

angular-datatables Buttons disappearing on data change #502

@ottoyiu

Description

@ottoyiu

Hello,

I'm using angular-datatables v0.5.1, along with the Buttons plugin, using the Angular data model way (datatable="ng"), and when I change the data of the table - 'Copy', 'Print', 'CSV' buttons from the plugin just disappears.

            <div>
                <table id="node-table" datatable="ng" class="table table-striped"
                       dt-options="dtOptions" dt-instance="dtInstance">
                    <thead>
                    <tr>
                        <th ng-repeat="col in cols">{{col.title}}</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>test</td>
                    </tr>
                    <tr ng-repeat="row in rows">
                        <td ng-repeat="col in cols">
                            {{row[col.field]}}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>

Any changes to the rows scope variable, will rid of the Buttons.

My dtOptions as follows:

        $scope.dtOptions = DTOptionsBuilder.newOptions()
            .withPaginationType('full_numbers')
            .withBootstrap()
            .withButtons([
                'copy', 'colvis', 'csv', 'print']);

I also tried re-creating the dtOptions after the data change, but no luck there.

This isn't a problem if i use dtColumns, and load data using promises.

Thanks,
Otto

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions