i using code add new row in table:
var ca = function() { this.caname = null; this.caadress = null; this.caidnum = null; this.cacontact = null; this.caname = null; this.canote = null; this.catype = null; }; newcreditrows = function () { this.creditrows.push(new ca()); };
the problem have can not remove new row(added newcreditrows
function). have tried in few different ways like: this.creditrows.remove(ca);
without luck. need remove it, because null values inserted in observable array , creating huge problems when i'm looping trough records. i'm sure i'm missing small, junior developer, i'm not able fix it.
take @ this fiddle
var vm = { newcreditrows : function () { this.creditrows.push(new ca()); }, remove : function(ca){ vm.creditrows.remove(ca); }, creditrows : ko.observablearray() };
i hope helps.
Comments
Post a Comment