Skip to content

Instantly share code, notes, and snippets.

@Senhordim
Created April 3, 2016 16:15
Show Gist options
  • Save Senhordim/89d129e7996dd944d9df73b9cfa26fd1 to your computer and use it in GitHub Desktop.
Save Senhordim/89d129e7996dd944d9df73b9cfa26fd1 to your computer and use it in GitHub Desktop.
getList(successCallback){
let storage = new Storage(SqlStorage);
storage.query("SELECT * FROM accounts").then((data) => {
let list = [];
for (var i = 0; i < data.res.rows.length; i++) {
let item {};
item.id = data.res.rows.item(i).id;
item.description = data.res.rows.item(i).description;
list.push(item);
// Callback
successCallback(list);
}
}, (error) => {
console.log("Erro ao tentar criar tabela" + JSON.stringify(error.err));
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment