I’m having an issue with the SQLite table. I’m sure its something in my code. When I create the table the only things that show are the rows themselves. The actual data is missing. Its just blank rows (which do correspond to how many I have in the SQLite database file). What is wrong in my code?
require ("sqlite3") local path = system.pathForFile("test.db", systemDocumentsDirectory) local db = sqlite3.open( path ) local table\_options = { top = 50, onRowRender = onRowRender, } local tableView = widget.newTableView( table\_options ) for row in db:nrows("SELECT \* FROM project") do local rowParams = { id = row.id, name = row.name, description = row.description, number = row.number, } tableView:insertRow( { rowHeight = 30, rowColor = { default={0.8,0.8,0.8,0.8} } lineColor = { 1, 0, 0 } params = rowParams, } ) end local function onRowRender( event ) local row = event.row local font = native.systemFont local fontsize = 25 local rowHeight = row.height / 2 local options\_id = { parent = row, text = row.params.id, x = 50, y = rowHeight, font = font, fontSize = fontSize, } row.id = display.newText( options\_id ) row.id.anchorX = 0 row.id:setFillColor( 155, 152, 253 ) local options\_name = { parent = row, text = row.params.name, x = 100, y = rowHeight, font = font, fontSize = fontSize, } row.name = display.newText( options\_name ) row.name.anchorX = 0 row.name:setFillColor( 1, 12, 23 ) local options\_description = { parent = row, text = row.params.description, x = 150, y = rowHeight, font = font, fontSize = fontSize, } row.description = display.newText( options\_description ) row.description.anchorX = 0 row.description:setFillColor( 1, 12, 23 ) local options\_number = { parent = row, text = row.params.number, x = 200, y = rowHeight, font = font, fontSize = fontSize, } row.number = display.newText( options\_number ) row.number.anchorX = 0 row.number:setFillColor( 1, 12, 23 ) sceneGroup:insert(row.id) sceneGroup:insert(row.name) sceneGroup:insert(row.description) sceneGroup:insert(row.number) end -------------------------------------------------------------------------- end
