Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Im looking for some help with the grid partial view. I would like to add the row name as a class in the partial.
I can get the rowName in the cfg attrs, but it outputs in all properties.
Any help or ideas would be grateful
Martin
@functions { public static MvcHtmlString RenderElementAttributes(dynamic contentItem) { var attrs = new List<string>(); var rowName = contentItem.name; JObject cfg = contentItem.config; if(cfg != null) foreach (JProperty property in cfg.Properties()) { attrs.Add(property.Name + "=\"" + rowName + property.Value.ToString() + "\""); } JObject style = contentItem.styles; if (style != null) { var cssVals = new List<string>(); foreach (JProperty property in style.Properties()) cssVals.Add(property.Name + ":" + property.Value.ToString() + ";"); if (cssVals.Any()) attrs.Add("style=\"" + string.Join(" ", cssVals) + "\""); } return new MvcHtmlString(string.Join(" ", attrs)); } }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Grid Partial - Row Name as class
Hi,
Im looking for some help with the grid partial view. I would like to add the row name as a class in the partial.
I can get the rowName in the cfg attrs, but it outputs in all properties.
Any help or ideas would be grateful
Martin
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.