Beispiel #1
0
        protected TableRow RenderDataRow(Dictionary <string, string> data)
        {
            var dataRow = Instantiate <TableRow>(templateDataRow, "Data Row");

            table.AddRow(dataRow);

            // create the data cells
            foreach (var heading in headings)
            {
                var dataCell = Instantiate <TableCell>(templateDataCell, "Data Cell");
                dataRow.AddCell(dataCell);

                var text = dataCell.GetComponentInChildren <Text>();
                text.text = data.ContainsKey(heading) ? data[heading] : String.Empty;
            }

            dataRows.Add(dataRow);

            XmlLayoutTimer.AtEndOfFrame(() => { if (table != null)
                                                {
                                                    table.CalculateLayoutInputHorizontal();
                                                }
                                        }, this);

            return(dataRow);
        }