문제

I have a Kendo UI grid with quantity and cost columns.

I want to display the total amount (sum of the cost * quantity of each row) I am wanting to get (and display this value) as the user is changing say the quantity. However the grid only update the ViewModel if you click into another cell or off the grid. This is when the change event is fired.

Is there a way of forcing a change/update to the ViewModel on click and keyup anywhere on the grid? (While still keeping focus in the cell the user is editing)

도움이 되었습니까?

해결책

Apply a class to the quantity and cost columns using templates. Then, you can use jquery to capture the keyups to update your viewmodel (Do whatever you do when the change event fires.)

$(".customClassName").keyup(function(){ //same as how you handle 'change' event})

It would help if you had a jsfiddle, but I hope this helps!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top