display pinned notes in garage.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-01-26 12:01:53 -07:00
parent d36f2c59e3
commit 1c2f83026c
4 changed files with 33 additions and 2 deletions

View File

@@ -28,4 +28,27 @@ function performLogOut() {
window.location.href = '/Login';
}
})
}
function loadPinnedNotes(vehicleId) {
var hoveredGrid = $(`#gridVehicle_${vehicleId}`);
if (hoveredGrid.attr("data-bs-title") == undefined) {
$.get(`/Vehicle/GetPinnedNotesByVehicleId?vehicleId=${vehicleId}`, function (data) {
if (data.length > 0) {
//converted pinned notes to html.
var htmlString = "<ul class='list-group list-group-flush'>";
data.forEach(x => {
htmlString += `<li><b>${x.description}</b> : ${x.noteText}</li>`;
});
htmlString += "</ul>";
hoveredGrid.attr("data-bs-title", htmlString);
new bootstrap.Tooltip(hoveredGrid);
hoveredGrid.tooltip("show");
}
});
} else {
hoveredGrid.tooltip("show");
}
}
function hidePinnedNotes(vehicleId) {
$(`#gridVehicle_${vehicleId}`).tooltip("hide");
}