sivaprakash
sivaprakash

Reputation: 167

knockout click event fires even during data change

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

Answers (1)

TSV
TSV

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

Related Questions