Skip to content

Trigger onChange on click #5

@JPustkuchen

Description

@JPustkuchen

When using onChange like described in README.md:

onChange: function(element) {
  $(element).closest('td').css('background-color', element.checked ? '#73B355' : '#FFFACD');
}

The function is only triggered after dragging, not on click. It would be good to allow to also trigger onChange if the user only clicked one checkbox to allow a consistent callback. I tried to use clickToToggle: true for normal checkboxes but that just killed the check functionality at all on click (checkboxes are no more being checked).

I think this is expected behaviour in most cases. In the example above the table cells are only highlighted if they were dragged, but not if they were clicked, which is the same in result.

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