Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Problem scrolling through table view
Started by ads_96 Mar 20 2019 09:16 AM

No replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ads_96

[GLOBAL: userInfoPane.html]
ads_96
  • Observer

  • 8 posts
  • Corona SDK

This is my table view of books:

 

 Attached File  tv.PNG   16.3KB   0 downloads

 

 

The colour of the text changes for each row that's selected to show that it has been clicked on.

I get this error anytime I try to scroll through the table view:

 

Attached File  err.PNG   9.93KB   0 downloads

 

Is there a way that I can scroll through the table view without touching any of the actual rows so I don't have this problem?

Or any other suggestions?

 

Here's code for the table view:

local function onRowRender( event )
    local row = event.row
	
    local rowHeight = row.contentHeight
    local rowWidth = row.contentWidth
	
	local present = ''
	if (row.params.InLibrary == 0) then
		present = 'Checked out'
	else
		present = 'In Library'
	end
	
	local rowText = display.newText( row, row.params.AuthorLastName .. '       ' .. row.params.AuthorFirstName .. '       ' .. row.params.Title .. '       ' ..  present, 0, 0, nil, 24 )
	
	if has_value(selected, row.params.ID) then
		rowText:setFillColor(0.7)
	else
		rowText:setFillColor(0)
	end
	
	rowText.anchorX = 0
	rowText.x = 0
	rowText.y = rowHeight * 0.5
end

local function onRowTouch( event )
	local ind = {}
	local row = event.row
	if has_value(selected, row.params.ID) then
		for k,v in ipairs(selected) do
			ind[v] = k
		end
		table.remove(selected, ind[row.params.ID])
	else 
		table.insert(selected, row.params.ID)
	end
	searchThisBook()
end

local tableView = widget.newTableView( 
    {
        left = 50,
        top = 250,
        height = 400,
        width = 650,
		onRowTouch = onRowTouch,
        onRowRender = onRowRender,
    }
)



[topic_controls]
[/topic_controls]