Displaying rows with no data

Displaying rows with no data

gzarambogzarambo Posts: 7Questions: 2Answers: 0
edited August 2011 in General
I am creating a table with an array of objects that I need displayed in a specific order. The problem that I'm having is that some of the rows don't contain any data and these rows don't display. However, I need the blank row to show that there's placeholders for a defined number of rows. Here's a simplified example of how I want to display the data:

[code]
Group Date
A 12/31/10
01/15/11

B 11/10/10


C


[/code]

So basically, I want to show that group A has 1 of 3 spots remaining, group B has 2 of 3 and C has 2 of 2. My data array in this case would look like this:

[code]
[
{"group": "A", "date": "12/31/10", "idx": 0},
{"group": "", "date": "01/15/11", "idx": 1},
{"group": "", "date": "", "idx": 2},
{"group": "B", "date": "11/10/10", "idx": 3},
{"group": "", "date": "", "idx": 4},
{"group": "", "date": "", "idx": 5},
{"group": "C", "date": "", "idx": 6},
{"group": "", "date": "", "idx": 7}
]
[/code]

But when I load this into the table, I get this:

[code]
Group Date
A 12/31/10
01/15/11
B 11/10/10
C

[/code]


If I add a 3rd column displaying the idx value, then it displays all of the rows. I thought of doing this and setting the bVisible option on that column to false, but then I'm right back where I started.

Is there a way to get the blank rows to display?

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    some browsers don't show a cell if it has no content. you can use " " instead of an empty string to fix that, usually
  • gzarambogzarambo Posts: 7Questions: 2Answers: 0
    Perfect! Thanks.
This discussion has been closed.