예제 #1
0
        protected override List <SlickColumn> GetColumns()
        {
            var self = this;

            return(new List <SlickColumn>
            {
                new SlickColumn {
                    Field = "text", Title = "Kayıt", Width = 80, Format =
                        SlickFormatting.TreeToggle(() => self.view, x => x.Id, ctx =>
                    {
                        var cls = "check-box";
                        var item = (CheckTreeItem)ctx.Item;

                        bool threeState = IsThreeStateHierarchy();
                        if (item.IsSelected)
                        {
                            if (threeState && !item.IsDescendantsSelected)
                            {
                                cls += " partial";
                            }
                            else
                            {
                                cls += " checked";
                            }
                        }

                        return "<span class=\"" + cls + "\"></span>" +
                        Q.HtmlEncode(ctx.Value);
                    })
                }
            });
        }
예제 #2
0
        protected override List <SlickColumn> GetColumns()
        {
            var self = this;

            return(new List <SlickColumn>
            {
                new SlickColumn {
                    Field = "text", Title = "Kayıt", Width = 80, Format =
                        SlickFormatting.TreeToggle(() => self.view, x => x.Id, ctx =>
                    {
                        var cls = "check-box";
                        var item = ((object)ctx.Item).As <TItem>();

                        if (item.HideCheckBox)
                        {
                            return GetItemText(ctx);
                        }

                        bool threeState = IsThreeStateHierarchy();
                        if (item.IsSelected)
                        {
                            if (threeState && !item.IsAllDescendantsSelected)
                            {
                                cls += " partial";
                            }
                            else
                            {
                                cls += " checked";
                            }
                        }

                        return "<span class=\"" + cls + "\"></span>" +
                        GetItemText(ctx);
                    })
                }
            });
        }