Skip to content

Clear table only works for init model value #11

@bjarnef

Description

@bjarnef

It seems "Clear table" button only works for init model value.

If you change values in the table cells and click on "Clear table" it doesn't reset the cell values.

.. or it seems to work on first click, but not on subsequent clicks.

If I change this:

$scope.clearTable = function () {
        if (confirm("Are you sure you wish to remove everything from the table?")) {
            $scope.model.value = defaultModel;
        }
    }

to this it seems to work:

$scope.clearTable = function () {
        if (confirm("Are you sure you wish to remove everything from the table?")) {
            $scope.model.value = {
        useFirstRowAsHeader: false,
        useLastRowAsFooter: false,
        tableStyle: null,
        columnStylesSelected: [
           null,
           null
        ],
        rowStylesSelected: [
           null,
           null,
           null
        ],
        cells: [
            [{ value: "" }, { value: ""}],
            [{ value: "" }, { value: ""}],
            [{ value: "" }, { value: ""}],
        ]
    };
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions