you’ve only given a code example which uses the ‘summary’ element:
local details = display.newText(listRecs[idx].summary, 10, list.height - 70, display.contentWidth - 20, display.contentHeight, Helvetica, 14 )
since that was the only data you’ve actually shown to use, option 2 was supposed to be an example of saving that part of your data:
mydata.summary = listRecs[idx].summary
of course you could save more elements from the record if you’d like in that manner.
mydata.summary = listRecs[idx].summary mydata.date = listRecs[idx].date mydata.title = listRecs[idx].title
–== sqlite records
not having used sqlite myself for data storage, i figured that it would give back a list of table structures for each record. this is indicated in your code by the variable ‘a’:
local function loadData() local sql = "select \* from News" for a in db:nrows(sql) do listRecs[#listRecs+1] = { id = a.id, date = a.date, title = a.title, summary = a.summary, text = a.text } end end
since ‘a’ is *already* a Lua table, you ought to be able to simplify the above by just saving ‘a’ instead of creating a new table:
local function loadData() local sql = "select \* from News" for a in db:nrows(sql) do listRecs[#listRecs+1] = a end end
so option three is related to that, i.e., just saving the record (Lua table) from the results:
mydata.record = listRecs[idx\_of\_tapped\_row]
remember that the intent of ‘mydata’ is to share from scene one what you need in scene two. if that’s just one element of a row, like ‘summary’, then you could just save that (option 2). or, if you need the whole record, you can either save the table (option 3), or save the index of the row and perform a search in scene 2 using the row index to get the row (option 1).
again, the choice is yours depending on how you want to structure your code.
cheers,
dmc