<div class="control" style="display:none; margin-top:100px;">
<span class="txt">Current Progress</span>
@Html.EJ().ProgressBar("progress").Percentage(10).Height("20px").ClientSideEvents(e => e.Create("onCreate"))
</div>
<br/>
<div id="ControlRegion">
@(Html.EJ().Grid<object>("FlatGrid")
.AllowPaging()
.Columns(col =>
{
col.Field("OrderID").Add();
col.Field("EmployeeID").Add();
col.Field("CustomerID").Add();
col.Field("ShipCountry").Add();
col.Field("Freight").Add();
}).ClientSideEvents(e => e.ActionBegin("onBegin").DataBound("onBound").ActionComplete("onComplete"))
)
</div> |
<script>
function onBegin() {
$(".control").css("display", "block");
}
function onCreate() {
this.setModel({ text: this.getPercentage() + " %" });
}
function onBound() {
var progressObj = $("#progress").ejProgressBar("instance");
setTimeout(function () {progressObj.setModel({ percentage: 100 });
progressObj.setModel({ text: progressObj.getPercentage() + " %" });
}, 500)
}
function onComplete() {
var progressObj = $("#progress").ejProgressBar("instance");
progressObj.setModel({ percentage: 80 });
progressObj.setModel({ text: progressObj.getPercentage() + " %" });
}
</script> |