widget tableView category problem

Hi,

I wonder if someone can help me with my tableView?
I can’t get a category to show up in my tableView. Here is my data structure with categoryName as shown in the API docs

itemData =
{
{
first cell data…
},
{
categoryName = “Name”
},
{
second cell data…
}
}

Whatever I try I can’t get a category to show up.

Also I was wondering if there is a way to add any e3xtra content to a table cell such as a price label?

[import]uid: 61520 topic_id: 13910 reply_id: 313910[/import]

Is this using the widget.newTableView()? If so, you need to use some specific table data.

itemData = { {title={label="This is entry 1."}, subtitle={label="Price"}}, {categoryName="Category Name"}, {title={label="This is entry 2."}, subtitle={label="Price"}} }

Unfortunately you can only use two pieces of information right now: title and subtitle. Each can be manipulated in terms of position and size (subtitle doesn’t need to be tiny and underneath title) but you can’t make it show other text elements yet.
[import]uid: 41884 topic_id: 13910 reply_id: 51223[/import]

I appreciate your reply. However what you have shown me is the same as I posted originally - I just left out the specific data to save time and space. Here is my actual code. If anyone can see where I’m going wrong then please let me know. With the code below only the first table cell shows. If I remove the category it shows both cells. I have tried every possible way of formatting the categoryName table…

itemData =
{
{
title = { label=“Free Sample”, font = “Helvetica-Bold”, size = 22, color = { 0, 0, 0 }, left = 10, top = 10 },
icon = { image = “style-genius-pnk.png”, width = 72, height = 72, baseDir = system.ResourcesDirectory, paddingTop = 10, paddingLeft = 10, paddingRight = 12 },
onRelease = onFreeSampleRelease,
subtitle = { label = “A sneak peak at some”, font = “Helvetica”, size = 16, color = { 100, 100, 100 }, left = 10, top = 3, padding = 3 },
hideArrow = true
},
{
categoryName = “Category name”
},
{
title = { label=“50 DIY styles”, font = “Helvetica-Bold”, size = 22, color = { 0, 0, 0 }, left = 10, top = 10 },
icon = { image = “style-genius-pnk.png”, width = 72, height = 72, baseDir = system.ResourcesDirectory, paddingTop = 10, paddingLeft = 10, paddingRight = 12 },
onRelease = makePurchase,
subtitle = { label = “1.19”, font = “Helvetica”, size = 16, color = { 100, 100, 100 }, left = 120, top = 3, padding = 3 },
hideArrow = true
}
} [import]uid: 61520 topic_id: 13910 reply_id: 51261[/import]

I was expecting as much; obviously you’re editing down code for readability/privacy reasons right? :slight_smile:

(For future posts, try to encapsulate the code in your forum posts with < code >< / code > (minus the spaces) - it makes it much easier for people to read and comment on)

I copy-pasted your code into a fresh main.lua, added the widget require line, and then used a blank (no special settings) call to newTableView.

I only needed to disable two lines for it to work:
a. The icon (since I don’t have your images nor a standin at 72x72)
b. onRelease (since I don’t have your onRelease function)

So areas for you to investigate:

Does the category show up if…

  1. you remove any special newTableView settings?
  2. you disable either onRelease
  3. you comment out either icon

This widget has some wonky-ness when it comes to formatting (ie: it really doesn’t seem to behave well at odd heights) so it’s entirely possible something there is mucking it up.

If you’re running this code in another lua file you may also want to paste it into a new temp main.lua for ease-of-bug-checking. [import]uid: 41884 topic_id: 13910 reply_id: 51309[/import]

Never did get this to work… Having to go without categories. [import]uid: 61520 topic_id: 13910 reply_id: 54727[/import]

Have you tried using Listview instead? That supports categories. I needed to do some editing to sort within them, but it’s fairly reliable. [import]uid: 41884 topic_id: 13910 reply_id: 54730[/import]