Skip to content
Snippets Groups Projects
Commit 5481ef88 authored by Armand Bahi's avatar Armand Bahi
Browse files

Requêteur : mise à jour du nombre d'enregistrements après suppression

parent d8207d06
Branches
Tags
No related merge requests found
......@@ -686,14 +686,10 @@ nsVmap.nsToolsManager.AdvancedSelect.prototype.AdvancedSelectController.prototyp
setTimeout(function () {
// Affiche la modale
$('#select-list-modal').modal('show');
// Rafraichit les métiadonnées
this_.refreshTablesMetadata();
// Affiche l'onglet correspondant (si besoin)
this_.$scope_.$applyAsync(function () {
if (goog.isDefAndNotNull(boId)) {
this_['sSelectedBo'] = boId;
} else {
this_['sSelectedBo'] = oVmap.getToolsManager().getBasicTools().getSelect().getSelectedBo();
}
})
this_.autoSelectTableBo(boId);
}, 100);
});
......@@ -1936,6 +1932,56 @@ nsVmap.nsToolsManager.AdvancedSelect.prototype.AdvancedSelectController.prototyp
return result;
};
/**
* Select automatically the business object
* Sélectionne automatiquement l'objet métier à utiliser par défaut
*
* @param {string} boId force the selection on the given business object
* @export
*/
nsVmap.nsToolsManager.AdvancedSelect.prototype.AdvancedSelectController.prototype.autoSelectTableBo = function (boId) {
oVmap.log('nsVmap.nsToolsManager.AdvancedSelect.prototype.AdvancedSelectController.prototype.autoSelectTableBo');
var this_ = this;
this_.$scope_.$applyAsync(function () {
if (goog.isDefAndNotNull(boId) && goog.isDefAndNotNull(this_['tableSelectionMetadata'][boId])) {
this_['sSelectedBo'] = boId;
} else {
if (!goog.isDefAndNotNull(this_['tableSelectionMetadata'][this_['sSelectedBo']])) {
this_['sSelectedBo'] = oVmap.getToolsManager().getBasicTools().getSelect().getSelectedBo();
}
}
});
}
/**
* Refresh the selection metadata
* Rafraichit les métadonnées du requêteur (nombre d'enregistrements etc...)
*
* @export
*/
nsVmap.nsToolsManager.AdvancedSelect.prototype.AdvancedSelectController.prototype.refreshTablesMetadata = function () {
oVmap.log('nsVmap.nsToolsManager.AdvancedSelect.prototype.AdvancedSelectController.prototype.refreshTablesMetadata');
var this_ = this;
this_.$scope_.$applyAsync(function () {
for (var sBoId in this_['tableSelection']) {
if (this_['tableSelection'].hasOwnProperty(sBoId)) {
// Mise à jour du nombre d'enregistrements
if (goog.isDefAndNotNull(this_['tableSelectionMetadata'][sBoId])) {
if (goog.isArray(this_['tableSelection'][sBoId])) {
this_['tableSelectionMetadata'][sBoId]['total_row_number'] = this_['tableSelection'][sBoId].length;
}
}
}
}
});
}
/**
*
* @param {type} value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment