$(function () {
var $btnRefresh = $('#refreshTask');
var htmlTask = '
';
function listData() {
$btnRefresh.toggleClass('fa-spin');
$.bc({
url: Tasks.url, method: 'GET', swal: false,
callback: function (result) {
if (result) {
var content = result.map(function (task) {
return $.format(htmlTask, task.TaskName, task.UserName, task.AssignTime, task.Id);
}).join('');
$('#list-task').html(content);
}
$btnRefresh.toggleClass('fa-spin');
}
});
}
listData();
$btnRefresh.on('click', function () {
listData();
});
})