I have a web application where I am using Knockout js for client. I have a grid which has 3 columns, list price, discount and customer price. The list price get displayed in rounded values whereas discount and customer price needs to be displayed in 2 decimal places. Also, customer price should get auto-calculated if list price or discount changes.
To achieve this, I have onchange event on list price. Also I use, two observables, listPrice and displayedListPrice. List price to store unformatted value and displayedListPrice to store formatted value.
The following issue is in IE only – Inside the function I have a statement,
this.displayedListPrice(format(this.ListPrice));
The above statement cause onchange event to fire again. How can I prevent that?
Thanks!
Sorry, I was gone for a while and didn’t notice the comments from fellow users.
Anyways, this is what I did –
So, instead of using onChange event to capture the event and do processing, I used focus and blur events to do the same functionality.