In ASP.NET MVC, I’m using JSON and jquery to get data for a chart. Is there a way to disable controls and set cursor to wait while data is loading and chart is drawing?
An abstract of my code is
<script type="text/javascript">
$(document).ready(function () {
$.getJSON(
'@Url.Action("JsonPlot", "Home")',
function (chartData) {
var plot1 = $.jqplot('chartdiv', [points], {...});
});
});
</script>
Where can I put
$("*").attr("disabled", "disabled");
$('body').css('cursor', 'wait');
and then
$("*").removeAttr('disabled');
$('body').css('cursor', 'auto');
?
Thanks!
To take full advantage of the jQuery AJAX callbacks, you should use
$.ajax: