Reputation: 167
Knockout click event fires even during data-bind.
Below is my view
<th class="cursor-pointer underline"
data-bind="click:javascripr:SortColumn($data.ColumnID)">
I need click event to be fired only when i click on
Upvotes: 0
Views: 58
Reputation: 7641
You shoould pass the function to the click binding:
<th class="cursor-pointer underline"
data-bind="click: function() { SortColumn($data.ColumnID); }">
Instead of calling it via this code:
SortColumn($data.ColumnID)
Upvotes: 1