コード例 #1
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            int k = -1;

            TreeItem item = LocalData.dynamic_List.Single(x => x.Tree_ID == Par_ID);

            builder.OpenElement(k++, "div");
            builder.AddAttribute(k++, "id", Comp_ID);
            builder.AddAttribute(k++, "style", "width:400px;max-height:26px;position:relative;");

            SvgHelper1.Cmd_Render(LocalTreeFunctions.Cmd_Create_Dynamic_Icon(item), k, builder, item.Tree_ID);

            builder.OpenElement(k++, "span");


            //Console.WriteLine("abc " + item.Tree_Column + " " + DateTime.Now.ToString("mm:ss.fff"));

            if (item.Tree_IsSelected)
            {
                //Console.WriteLine("abc is selected");
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;cursor:pointer;background-color:yellow;color:blue;border-style:solid;border-width:1px;border-color:red;");
            }
            else
            {
                //Console.WriteLine("abc is not selected");
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;cursor:pointer;");
            }


            builder.AddAttribute(k++, "onclick", EventCallback.Factory.Create(this, e => Cmd_Tree_Item_Select(item.Tree_ID)));

            builder.AddContent(k++, item.Tree_Column);

            builder.CloseElement();

            builder.CloseElement();


            base.BuildRenderTree(builder);
        }