1// Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification 2// for details on configuring this project to bundle and minify static web assets. 3 4// Write your JavaScript code. 5function openBlade(bladeId, backdropId) { 6 $(bladeId).show(); 7 $(backdropId).show(); 8} 9 10function closeBlade(bladeId, backdropId) { 11 $(bladeId).hide(); 12 $(backdropId).hide(); 13} 14 15function reviveGridHandlers(columns, viewName) { 16 if (!Array.isArray(columns)) return columns; 17 18 for (const col of columns) { 19 // Buttons column: convert onClick: "fnName" -> onClick: window.fnName 20 if (col && col.type === "buttons" && Array.isArray(col.buttons)) { 21 col.buttons = col.buttons.map(b => { 22 if (b && typeof b.onClick === "string") { 23 const fn = window[b.onClick]; 24 if (typeof fn === "function") { 25 return { ...b, onClick: fn }; 26 } else { 27 console.warn(`Missing handler function '${b.onClick}' for ${viewName} grid button.`); 28 } 29 } 30 return b; 31 }); 32 } 33 34 // If we ever use cellTemplate / headerCellTemplate by name... 35 if (col && typeof col.cellTemplate === "string") { 36 const fn = window[col.cellTemplate]; 37 if (typeof fn === "function") col.cellTemplate = fn; 38 } 39 if (col && typeof col.headerCellTemplate === "string") { 40 const fn = window[col.headerCellTemplate]; 41 if (typeof fn === "function") col.headerCellTemplate = fn; 42 } 43 } 44 return columns; 45} 46 47function adjustPageSize(grid) { 48 grid.updateDimensions(); 49 50 const rowsAreaHeight = grid.getView("rowsView").element().height(); 51 const rowHeight = grid.element().find(".dx-data-row").first().outerHeight(); 52 53 if (!rowsAreaHeight || !rowHeight) return; 54 55 const rowsThatFit = Math.max(1, Math.floor(rowsAreaHeight / rowHeight)); 56 57 if (grid.option("paging.pageSize") !== rowsThatFit) { 58 grid.option("paging.pageSize", rowsThatFit); 59 } 60} 61function queueBadgeTemplate(container, options) { 62 const value = String(options?.value ?? "").trim(); 63 const normalized = value.toUpperCase(); 64 let statusClass = "queue-badge-active"; 65 66 if (normalized === "COMPLETED") statusClass = "queue-badge-completed"; 67 else if (normalized === "CANCELED") statusClass = "queue-badge-canceled"; 68 else if (normalized === "EXPIRED") statusClass = "queue-badge-expired"; 69 70 $("<span>") 71 .addClass(`queue-badge ${statusClass}`) 72 .text(value || "â") 73 .appendTo(container); 74} 75 76window.queueBadgeTemplate = queueBadgeTemplate;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.