MVCxClientUtils.FinalizeCallback Method
Loads resources required by DevExpress MVC extensions.
Declaration
static FinalizeCallback(): void
Remarks
You can use jQuery.ajax functions or call SetContentHtml
methods to load HTML content dynamically in callbacks. If the loaded content includes DevExpress MVC extensions and these extensions require specific resources, such as scripts, CSS files, or images, you should force loading of these resources.
Call the FinalizeCallback
method to load required DevExpress resources after a DevExpress MVC extension has been loaded in a callback.
Example 1: Load an Extension in jQuery.ajax Function
<script>
function onReloadClick(s, e) {
$.ajax({
type: "POST",
url: "@Url.Action("_FileManagerPartial")",
success: function(response) {
$("#fileManagerContainer").html(response);
MVCxClientUtils.FinalizeCallback();
}
});
}
</script>
@using(Html.BeginForm()) {
<div id="fileManagerContainer">
@Html.Action("_FileManagerPartial")
</div>
@Html.DevExpress().Button(settings => {
settings.Name = "btnReload";
settings.Text = "Reload";
settings.ClientSideEvents.Click = "onReloadClick";
}).GetHtml()
}
Example 2: Load an Extension in SetContentHtml
Method
The following DevExpress MVC extensions implement the SetContentHtml
method:
<script>
...
$.ajax({
...
success: function (response) {
rp.SetContentHtml(response);
MVCxClientUtils.FinalizeCallback();
}
});
</script>
@Html.DevExpress().RoundPanel(settings => {
settings.Name = "rp";
settings.EnableClientSideAPI = true;
}).GetHtml()
See Also