Hi Rahul,
I have checked you application and saw,
onchange event you are using only current value thats why you are able to update only first row,
you need to loop on list and update accordingly your condition.
see below image like this

Or you can use onchnage event on row vise than your logic will work
Hope this will help you
Regards
Rahul