<script type="text/x-jsrender" id="columnTemplate">
{{if EmployeeID<3}}
<div id="progressbar" class="bg-success" role="progressbar">
</div>
{{else EmployeeID>2}}
<div id="progressbar" class="bg-warning" role="progressbar">
</div>
{{/if}}
</script>
@(Html.EJ().Grid<object>("ColumnTemplate")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowPaging()
.PageSettings(page => { page.PageSize(10); })
.Columns(col =>
col.HeaderText("Progress Bar").Template("#columnTemplate").TextAlign(TextAlign.Center).Width(110).Add();
. . .
})
.ClientSideEvents(eve =>{
eve.TemplateRefresh("refresh");
})
)
<script>
function refresh(args) {
$(args.cell).find("#progressbar").ejProgressBar({ value: args.data.EmployeeID });
}
</script> |
<script type="text/x-jsrender" id="columnTemplate">
……………
</script>
@(Html.EJ().Grid<object>("Grid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.ClientSideEvents(eve =>
{
eve.TemplateRefresh("refresh");
})
………….
.Columns(col =>
{
………..
col.HeaderText("Progress Bar").Template("#columnTemplate").TextAlign(TextAlign.Center).Width(110).Add();
})
)
<script>
function refresh(args) {
$(args.cell).find("#progressbar").ejProgressBar({ value: args.data.EmployeeID, text: args.data.EmployeeID + " %"});
}
</script>
|