javascript - Knockout dirty flag event -
i've used dirty flag blog post here knockmeout implement such flag in model, can not work properly. somehow flag never set true.
additionaly want subscribe event triggered every time dirty flag set true. (i'll reset manually).
here's fiddle shows issue.
can point me in right direction?
a couple of small things:
- when use
spantags should not self-closing (so<span></span>). preventing final binding being shown. - if create view model inside of object literal,
thisnot yet refer view model, when created dirty flag not tracking filter object. if want object literal, want create dirty flag afterwards. - the value binding when used select populate model value string. so, changed
1'1', otherwise dirty immediately. there way force numeric using writeable computed observable. here 1 technique.
here updated sample: http://jsfiddle.net/rniemeyer/xw76d/4/
Comments
Post a Comment