【发布时间】:2016-03-29 12:35:11
【问题描述】:
请帮我解决这个问题:我需要在更新过程后更改值,到目前为止,我的代码不起作用。
这是代码:
Template. edit_peralatan.events({
'submit .peralatan': function (event){
event.preventDefault();
var currentPostId= Session.get ('this._id');
var profil=Profil.findOne(currentPostId);
var properties={
kategori: $(event.target).find('[name=kategori]'). val(),
jenama: $(event.target).find('[name=jenama]'). val(),
trPerolehan: $(event.target).find('[name=trPerolehan]'). val(),
noSiri: $(event.target).find('[name=noSiri]'). val(),
noRedicare: $(event.target).find('[name=noRedicare]'). val(),
};
Profil.update( currentPostId,{ $set: properties },
function (error){
if (error){
alert (error.reason);
} else {
Router.go('list_inventori',{_id:currentPostId});
}
});
}
});
【问题讨论】:
-
具体一点 - 什么不起作用?
-
这是代码。我不知道如何解决它。单击“提交”按钮后,值没有改变。
标签: meteor