| 33538 |
tejus.loha |
1 |
$(document).on('click', ".mk_similar_model", function () {
|
|
|
2 |
reloadSimilarModel("main-content");
|
| 33527 |
amit.gupta |
3 |
});
|
|
|
4 |
|
| 33538 |
tejus.loha |
5 |
$(document).on('click', ".addSimilarModel", function () {
|
|
|
6 |
let catalog_id = document.querySelector('select[name="catalogId"]').value;
|
|
|
7 |
var selectElement = document.getElementById('contentModel');
|
|
|
8 |
var selectedOptions = Array.from(selectElement.selectedOptions);
|
|
|
9 |
var similarCatalogIds = selectedOptions.map(option => option.value);
|
|
|
10 |
console.log('similarCatalogIds values:', similarCatalogIds);
|
|
|
11 |
console.log("catalogId:", catalog_id);
|
|
|
12 |
var data = {
|
|
|
13 |
catalogId: catalog_id,
|
|
|
14 |
similarCatalogIds: similarCatalogIds
|
|
|
15 |
};
|
|
|
16 |
if (confirm("Are you confirm to add similar models")) {
|
|
|
17 |
doPostAjaxRequestWithJsonHandler(`${context}/similar-model/create`, JSON.stringify(data), function (response) {
|
|
|
18 |
reloadSimilarModel("main-content");
|
|
|
19 |
});
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
});
|
|
|
23 |
|
|
|
24 |
function reloadSimilarModel(domId) {
|
|
|
25 |
doGetAjaxRequestHandler(`${context}/similar-model`,
|
|
|
26 |
function (response) {
|
|
|
27 |
$('#' + domId).html(response);
|
|
|
28 |
});
|
| 33527 |
amit.gupta |
29 |
}
|