I am trying to load records using breeze. While loading record i am showing spin icon. But somehow spin icon seems to stop while records are being loaded in grid. Here is my html
<div id="showSpin" data-bind="visible: isSpinning" style="padding: 10px; position: absolute; top:248px;left: 320px; background-color: #FFF; opacity: 0.9; filter: alpha(opacity=90);">
<img src="/images/spin.gif" />
</div>
here is my code to load image
isSpinning(true)
context.getData(name, records).then(function (data) {
isSpinning(false);
setTimeout(function () {
isSpinning(false);
}, 300);
})
.fail("Record not found");
Update1 I tried below code as per answer but nothing happens. I also included css. But cant see anything.
<div id="loading" data-bind="visible: isSpinning" style="padding: 10px; position: absolute; top:240px;left: 280px; background-color: #FFF; opacity: 0.9; filter: alpha(opacity=90);">
<i class="icon-spin " style="width: 40px"></i>
<!--<img src="../../../../../Content/images/download.jpg" style="width: 40px" />-->
</div>