-
Notifications
You must be signed in to change notification settings - Fork 0
/
Custom_Engine.cshtml
41 lines (33 loc) · 1 KB
/
Custom_Engine.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@using Incoding.MvcContrib
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{
<script src="@Url.Content("~/Scripts/jQuery.tmpl.min.js")"> </script>
<script type="text/javascript">
function IncJqueryTmplTemplate() {
this.compile = function(tmpl) {
return tmpl;
};
this.render = function(tmpl, data) {
var container = $('<div>');
$.tmpl(tmpl, data).appendTo(container);
return container.html();
};
}
ExecutableInsert.Template = new IncJqueryTmplTemplate();
</script>
}
@{ string tmplId = Guid.NewGuid().ToString(); }
<script type="jquery-tmpl" id="@tmplId">
{{each data}}
<li>${Title}</li>
{{/each}}
</script>
@(Html.When(JqueryBind.InitIncoding)
.Do()
.AjaxGet(Url.Action("FetchCountries", "Data"))
.OnSuccess(dsl => dsl.Self().Core().Insert.WithTemplateById(tmplId).Html())
.AsHtmlAttributes()
.ToTag(HtmlTag.Ul))