im starting to lower his head around the knockout, and if he correctly writes the code in view mode, which controls the animation of dom or lights, etc. As an example, I have this binding, which is passed to the div reference that I want to copy when the tr button is pressed.
<tr data-bind="click: function(data, event){$parent.Select('#PanelWrapper', $data)}">
In my view model, I have
self.Select = function (panel, e) { console.log(ko.toJS(e)); if(self.SelectedEmployee() === e)return; self.$PanelWrapper = $(panel); var $Bottom = parseInt(self.$PanelWrapper.css("bottom")); if($Bottom === 0){ self.$PanelWrapper.animate({ bottom:"-95" }, 500, function(){ self.SelectedEmployee(e); self.Editable(new Employee(ko.toJS(e))); }).animate({ bottom:"0" }, 500); }else{ self.SelectedEmployee(e); self.Editable(new Employee(ko.toJS(e))); self.$PanelWrapper.animate({ bottom:"0" }, 500); } };
I am wondering if this is really true and that it follows the vmmv methodology. Any help would be appreciated
source share