Open.Core.Lists.ListTemplates.DefaultListItem C# (CSharp) Method

DefaultListItem() public static method

Constructs the default HTML for an item in a list.
public static DefaultListItem ( object model ) : jQueryObject
model object
return jQueryObject
        public static jQueryObject DefaultListItem(object model)
        {
            // Setup initial conditions.
            IListItem listItem = model as IListItem;

            // Create the root container.
            jQueryObject divRoot = Html.CreateDiv();

            // Create the label.
            jQueryObject spanLabel = Html.CreateSpan();
            spanLabel.AppendTo(divRoot);

            // Insert right-hand icon.
            string src = listItem == null
                                         ? ListHtml.ChildPointerIcon
                                         : listItem.RightIconSrc ?? ListHtml.ChildPointerIcon;
            jQueryObject img = Html.CreateImage(src, null);
            img.AddClass(ListCss.ItemClasses.IconRight);
            img.AppendTo(divRoot);

            // Apply CSS.
            divRoot.AddClass(ListCss.ItemClasses.DefaultRoot);
            spanLabel.AddClass(ListCss.ItemClasses.Label);
            spanLabel.AddClass(Css.Classes.TitleFont);

            // Finish up.
            return divRoot;
        }
    }
ListTemplates