【发布时间】:2016-11-22 02:51:53
【问题描述】:
我有这个查询数据库的方法。查询正在运行,我想使用查询的结果来做其他事情。问题是,我不能使用数据,因为它在目标文件中。
EventListener() {
this.store.db.executeSql('SELECT id, event FROM eventi WHERE status = "new"', null,
(resultset) => {
console.log(resultset)
alert(resultset)
}, this.NewEventerror)
}
如何取出来?我试过JSON.stringify(resultset),但警报和console.log 没有弹出。
有什么想法吗?
【问题讨论】:
-
你能附上
resultset对象的外观示例吗? -
而你的
alert语法不正确,在这里你可以看看你应该如何使用它:facebook.github.io/react-native/releases/0.29/docs/alert.html -
@Cherniv 不幸的是,我无法找出它的样子:/
-
你试过
JSON.parse(resultset)吗? -
在安卓模拟器上运行,chrome调试器在使用时报告
warning - exception while invoking a callback: {}。
标签: sql json object react-native tostring