Esempio n. 1
0
        public static string Sortable(this HtmlHelper htmlHelper, string id, string[] value, SortableTypes sortableType, object htmlAttributes, bool withoutScript)
        {
            // Create tag builder
            var builder = new TagBuilder("ol");

            // Create valid id
            builder.GenerateId(id);

            // Add attributes
            builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

            foreach (var v in value)
            {
                builder.InnerHtml += string.Format("\n\t<li class=\"{0}\"><span class=\"ui-icon ui-icon-arrowthick-2-n-s\"></span>{1}</li>", "ui-state-default", v);
            }

            // Render tag
            return(builder.ToString(TagRenderMode.Normal)
                   + (withoutScript == true ? string.Empty : "\n    " + RenderSortable(htmlHelper, new string[] { id }, sortableType)));
        }
Esempio n. 2
0
 public static string Sortable(this HtmlHelper htmlHelper, string id, string[] value, SortableTypes sortableType, bool withoutScript)
 {
     return(Sortable(htmlHelper, id, value, sortableType, null /*htmlAttributes*/, withoutScript));
 }
Esempio n. 3
0
 public static string Sortable(this HtmlHelper htmlHelper, string id, string[] value, SortableTypes sortableType, object htmlAttributes)
 {
     return(Sortable(htmlHelper, id, value, sortableType, htmlAttributes, false /*withoutScript*/));
 }
Esempio n. 4
0
        public static string RenderSortable(this HtmlHelper htmlHelper, string[] sortableIds, SortableTypes sortableType)
        {
            switch (sortableType)
            {
            case SortableTypes.Recommendation:
                return(RenderSortable(htmlHelper, sortableIds, new { }));

            case SortableTypes.DefaultFuntionality:
                return(RenderSortable(htmlHelper, sortableIds, new { }));

            default:        // Recommendation
                return(RenderSortable(htmlHelper, sortableIds, new { }));
            }
        }
Esempio n. 5
0
 public static string RenderSortable(this HtmlHelper htmlHelper, string[] sortableIds, SortableTypes sortableType)
 {
     switch (sortableType)
     {
         case SortableTypes.Recommendation:
             return RenderSortable(htmlHelper, sortableIds, new { });
         case SortableTypes.DefaultFuntionality:
             return RenderSortable(htmlHelper, sortableIds, new { });
         default:    // Recommendation
             return RenderSortable(htmlHelper, sortableIds, new { });
     }
 }
Esempio n. 6
0
        public static string Sortable(this HtmlHelper htmlHelper, string id, string[] value, SortableTypes sortableType, object htmlAttributes, bool withoutScript)
        {
            // Create tag builder
            var builder = new TagBuilder("ol");

            // Create valid id
            builder.GenerateId(id);

            // Add attributes
            builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

            foreach (var v in value)
            {
                builder.InnerHtml += string.Format("\n\t<li class=\"{0}\"><span class=\"ui-icon ui-icon-arrowthick-2-n-s\"></span>{1}</li>", "ui-state-default", v);
            }

            // Render tag
            return builder.ToString(TagRenderMode.Normal)
                + (withoutScript == true ? string.Empty : "\n    " + RenderSortable(htmlHelper, new string[] { id }, sortableType));
        }
Esempio n. 7
0
 public static string Sortable(this HtmlHelper htmlHelper, string id, string[] value, SortableTypes sortableType, object htmlAttributes)
 {
     return Sortable(htmlHelper, id, value, sortableType, htmlAttributes, false/*withoutScript*/);
 }
Esempio n. 8
0
 public static string Sortable(this HtmlHelper htmlHelper, string id, string[] value, SortableTypes sortableType, bool withoutScript)
 {
     return Sortable(htmlHelper, id, value, sortableType, null/*htmlAttributes*/, withoutScript);
 }