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); }) } }); }
protected SlickFormatter ItemLink(string itemType = null, string idField = null, Func <SlickFormatterContext, string> text = null, Func <SlickFormatterContext, string> cssClass = null, bool encode = true) { itemType = itemType ?? GetItemType(); idField = idField ?? GetIdFieldName(); return(SlickFormatting.ItemLink(itemType, idField, text, cssClass, encode)); }
protected virtual void OnClick(jQueryEvent e, int row, int cell) { var target = J(e.Target); if (target.HasClass("s-" + GetItemType() + "Link")) { e.PreventDefault(); EditItem(SlickFormatting.GetItemId(target)); } }
protected virtual void OnClick(jQueryEvent e, int row, int cell) { if (e.IsDefaultPrevented()) { return; } var target = J(e.Target); if (target.HasClass("s-EditLink")) { e.PreventDefault(); EditItem(SlickFormatting.GetItemType(target), SlickFormatting.GetItemId(target)); } }
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); }) } }); }