On click select all row

Here the code which i have used for show the tick mark in table row,On each row click tick mark showing and on other click its hiding.I added a button to select make all ticks visible(Select all),it not working

local function onRowRender( event ) local phase = event.phase local row = event.row chktick= display.newImage('images/kitchen/checktick.png',10,10); if(deviceName == "iPhone" or deviceName == "iPad") then chktick.x=303; chktick.isVisible = false; else chktick.x=303; chktick.isVisible = false; end chktick.y=row.contentHeight \* 0.5; row:insert(chktick); row:addEventListener("tap",onRowTouch); return true; end

local function onRowTouch( event ) local row = event.target; local \_chktick = event.target[6]; print("Comes here when touch"..row.index); if(flagvalue==1)then \_chktick.isVisible = true; flagvalue=0; else \_chktick.isVisible = false; flagvalue=1; end return true; end

Select all method

local function SelecetAllEventListener( event ) flagvalue=1; currentScene.reloadScene(); return true; end

Rowrender calling code

function scene:enterScene( event ) MenuID = event.params.currentMenuID; local group = self.view tableView = widget.newTableView { top = 85, left = 0, width = 320, height = 380, maskFile = "billmask.png", hideBackground = true, onRowRender = onRowRender, listener = tableViewListener, } end group:insert( tableView ) end

 

Please help me how to make visible all tick showable in using  SelecetAllEventListener?

Get rid of that currentScene.reloadScene()

and try tableView:reloadData()

http://docs.coronalabs.com/daily/api/type/TableViewWidget/reloadData.html

it returns Attempt to call method ‘reloadData’ (a nil value)

Probably your tableview is not in scope. http://lua-users.org/wiki/ScopeTutorial

You can perhaps assign the tableview to the scene table. So replace wherever you have tableView with scene.tableView

For example:

tableView = widget.newTableView

with

scene.tableView = widget.newTableView

Another way is to put

local tableView 

at the top of the file but in my opinion is not as clean.

Get rid of that currentScene.reloadScene()

and try tableView:reloadData()

http://docs.coronalabs.com/daily/api/type/TableViewWidget/reloadData.html

it returns Attempt to call method ‘reloadData’ (a nil value)

Probably your tableview is not in scope. http://lua-users.org/wiki/ScopeTutorial

You can perhaps assign the tableview to the scene table. So replace wherever you have tableView with scene.tableView

For example:

tableView = widget.newTableView

with

scene.tableView = widget.newTableView

Another way is to put

local tableView 

at the top of the file but in my opinion is not as clean.