35 lines
995 B
C#
35 lines
995 B
C#
using System.Text;
|
|
using System.Web.Mvc;
|
|
|
|
namespace Kreta.Web.Helpers
|
|
{
|
|
public static class GridTemplateExtensions
|
|
{
|
|
|
|
public static MvcHtmlString KretaGridTemplate(this HtmlHelper helper, string templateId)
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb
|
|
.Append($"<script id=\"{templateId}\" type=\"text/x-kendo-template\">")
|
|
.Append("</script>");
|
|
|
|
MvcHtmlString str = new MvcHtmlString(sb.ToString());
|
|
return str;
|
|
}
|
|
|
|
public static MvcHtmlString KretaTooltipTemplate(this HtmlHelper helper, string templateId, string content)
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb
|
|
.Append($"<script id=\"{templateId}\" type=\"text/x-kendo-template\">")
|
|
.Append(content)
|
|
.Append("</script>");
|
|
|
|
MvcHtmlString str = new MvcHtmlString(sb.ToString());
|
|
return str;
|
|
}
|
|
|
|
}
|
|
}
|