persistence.js add()函数不起作用 [英] persistence.js add() function not working

查看:97
本文介绍了persistence.js add()函数不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将对象保存到数据库:

I have tried to save an object to database:

Item = persistence.define('Item', {
imageUrl: "TEXT",
})

这是有效的,imageUrl是设置正确:

this is working,the imageUrl is set correctly:

var c = new Item({imageUrl: "a"});

这不起作用,imageUrl在db中为空

this is not working, imageUrl is empty in the db

var c = new Item();
c.imageUrl = "a";

这是有效的:

var c = new Item();
c._data.imageUrl = "a";

好像是一个错误。

推荐答案

我想我找到了原因,如果你使用jquery那么你必须使用:
e。 G。

I think I found the reason, If you are using jquery then you have to use: e. g.

obj.name(newValue) 

设置和

obj.name() 

获得attributs。

to get attributs.

你能否告诉我这些案件的文件在何处可以被找寻到?
https://groups.google.com/forum/ ?fromgroups =#!topic / persistencejs / zph_wV1sEic

Can you please tell me where the documentation for such cases can be found? https://groups.google.com/forum/?fromgroups=#!topic/persistencejs/zph_wV1sEic

这篇关于persistence.js add()函数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆