UNPKG

@titanium/turbo

Version:

<p align="center"> <img src="https://cdn.secure-api.org/images/turbo-title_400.png" /><br> <a href="https://www.npmjs.com/package/@titanium/turbo"> <img src="https://img.shields.io/npm/v/@titanium/turbo.png" /> </a> </p>

28 lines (22 loc) 533 B
var things = Alloy.Collections.things; var counter = 1; function showId(e) { if (e.row.model) { alert(e.row.model); } } function addThing(e) { // create the test fighter model var model = Alloy.createModel('thing', { name: 'Thing ' + counter++ }); // add model to the collection and save it to sqlite things.add(model); model.save(); // let's refresh so we can see the ids coming from the // autoincrement field in the sqlite database in the // row click alerts things.fetch(); } things.fetch(); $.index.open();