javascript - Knockout mapping grid with dynamic adding of items not behaving -
i have nice knockout viewmodel list shown grid. use mapping plugin.
you can select items, reverse selection, remove items list , dynamically add items.
but if add item, can't remove or other items. if add 1 not show. computed value show lines
here fiddle isolating issue:
http://jsfiddle.net/medo/7jrnb/
self.add = function () { self.orderlines.push(ko.mapping.fromjs({ sku: "", qty: 1, name: "", originalsku: "", description: "", exists: false, selected:false })); };
delete , select items, well. press add item , deleting not work. pressing add again unexpected result.
knockout-2.2.1.js knockout mapping plugin v2.4.1
in add function, misspelled originalsku originalsku (different case). causes binding fail and, appears, stop knockout working. fix spelling , you're set.
Comments
Post a Comment