Skip to content

Instantly share code, notes, and snippets.

@NickersF
Created April 1, 2022 17:16
Show Gist options
  • Save NickersF/82f0449e8134d48646c5c8a95b992b77 to your computer and use it in GitHub Desktop.
Save NickersF/82f0449e8134d48646c5c8a95b992b77 to your computer and use it in GitHub Desktop.
Tile layout builder AJAX call without .when() wrapper
$.ajax({
type: "GET",
url: "/" + controllerName + "/" + actionName
}).then((data) => {
console.log(performance.now());
self.configurationObject = JSON.parse(data);
self.tileLayoutRootElement = tileLayoutRootEl;
self.buildTileLayoutConfiguration();
if (data != undefined || null || "Error Message") {
$("#" + self.tileLayoutRootElement).kendoTileLayout(self.tileLayoutConfiguration);
let tileLayoutInstance = $("#" + self.tileLayoutRootElement).data("kendoTileLayout");
for (let key in self.configurationObject.Tiles) {
self.getTileLayoutHTML(self.configurationObject.Tiles[key].TemplateID, key, tileLayoutInstance);
}
} else {
console.log("Error");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment