Exemplo n.º 1
0
        protected override NodeBase CreateInternal(object data)
        {
            var values = data as List <string>;

            var complexNode = new ComplexNode("td");

            //complexNode.ChildNodes.Add(new SimpleNode("span", values != null ? Convert.ToString(RecordCount) : "") { Classes = new List<string>() { "rank-div" } });
            string colorValue = "";

            if (values[1].ToUpper().Contains("TOTAL"))
            {
                colorValue = ColorListDataSource.ColorOfTotal.Replace("#", "");
            }
            else if (UncheckedItem != null && UncheckedItem.Contains(values[1]))
            {
                colorValue = "";
                if (RecordCount != 0)
                {
                    complexNode.ChildNodes.Add(new SimpleNode("span", values != null ? Convert.ToString(RecordCount) : "")
                    {
                        Classes = new List <string>()
                        {
                            "rank-div"
                        }
                    });
                }
            }
            else
            {
                colorValue = _colorSource.GetNextColor();
                if (RecordCount != 0)
                {
                    complexNode.ChildNodes.Add(new SimpleNode("span", values != null ? Convert.ToString(RecordCount) : "")
                    {
                        Classes = new List <string>()
                        {
                            "rank-div"
                        }
                    });
                }
            }

            complexNode.ChildNodes.Add(new SimpleNode("span", string.Empty)
            {
                Classes = new List <string>()
                {
                    "color-div"
                },
                Styles = new Dictionary <string, string>()
                {
                    { "background-color", "#" + colorValue }
                }
            });

            RecordCount++;

            return(complexNode);
        }
Exemplo n.º 2
0
        protected override NodeBase CreateInternal(string data)
        {
            var cell     = new ComplexNode(_nodeName);
            var checkBox = new SimpleNode("input", "")
            {
                Attributes = new Dictionary <string, string>()
                {
                    { "type", "checkbox" },
                    { "checked", "checked" },
                    { "series-name", data },
                    { "onClick", "customTable.ChartUpdate('" + ParamName + "')" }
                }
            };

            if (!string.IsNullOrEmpty(UncheckedItem) && UncheckedItem.ToUpper().Contains(data.ToUpper()))
            {
                checkBox.Attributes.Remove("checked");
            }
            cell.ChildNodes.Add(checkBox);
            return(cell);
        }