correction gestion des 2 composants

This commit is contained in:
Christophe 2020-11-04 22:12:22 +01:00
parent a05c26c6ed
commit 1672098bab
3 changed files with 29 additions and 32 deletions

View file

@ -17,21 +17,25 @@
ref="montableau" ref="montableau"
></mon-tableau> ></mon-tableau>
</div> </div>
<span class="[(#ENV{apiuri_deux})gamutableSep]"></span>
<div class="gamutableDeux"> <BOUCLE_deux(CONDITION){si #ENV{apiuri_deux}|oui}>
[<span class="titre titreGamutableDeux">(#ENV{titreGamutableDeux})</span>] <span class="gamutableSep"></span>
<mon-tableau
apiuri="[(#ENV{apiuri_deux})]" <div class="gamutableDeux">
:tparpage="#ENV{tparpage_deux, [10, 20, 50, 'Tous']}" [<span class="titre titreGamutableDeux">(#ENV{titreGamutableDeux})</span>]
champcsv="[(#ENV{champcsv,html})]" <mon-tableau
delimitercsv="[(#ENV{delimitercsv,','})]" apiuri="[(#ENV{apiuri_deux})]"
namecsv="[(#ENV{namecsv_deux})]" :tparpage="#ENV{tparpage_deux, [10, 20, 50, 'Tous']}"
urlvuebloc="[(#ENV{urlvuebloc_deux})]" champcsv="[(#ENV{champcsv,html})]"
url_sort_asc="[(#ENV{sort_asc,#GET{sort_asc}})]" delimitercsv="[(#ENV{delimitercsv,','})]"
url_sort_desc="[(#ENV{sort_desc,#GET{sort_desc}})]" namecsv="[(#ENV{namecsv_deux})]"
ref="montableau" urlvuebloc="[(#ENV{urlvuebloc_deux})]"
></mon-tableau> url_sort_asc="[(#ENV{sort_asc,#GET{sort_asc}})]"
</div> url_sort_desc="[(#ENV{sort_desc,#GET{sort_desc}})]"
ref="montableau"
></mon-tableau>
</div>
</BOUCLE_deux>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">

View file

@ -26,9 +26,7 @@ jQuery(function () {
if (nomBlocAjaxReload !== undefined) { if (nomBlocAjaxReload !== undefined) {
ajaxReload(nomBlocAjaxReload, { ajaxReload(nomBlocAjaxReload, {
args: { id }, args: { id },
callback: function () { callback: function () {},
console.log('couco reload');
},
}); });
} }
}); });
@ -147,11 +145,6 @@ function trouver_index(table, id) {
}); });
return i; return i;
} }
String.fromHtmlEntities = function (string) {
return (string + '').replace(/&#\d+;/gm, function (s) {
return String.fromCharCode(s.match(/\d+/gm)[0]);
});
};
let monTableau = { let monTableau = {
props: { props: {
tparpage: { tparpage: {
@ -262,7 +255,10 @@ let monTableau = {
}, },
methods: { methods: {
calculer_nameLocalStorage() { calculer_nameLocalStorage() {
return this.apiuri.match(/.*page=(.*)/)[1]; if (this.apiuri) {
return this.apiuri.match(/.*page=(.*)/)[1];
}
return '';
}, },
chargerJson(id) { chargerJson(id) {
let url = this.apiuri; let url = this.apiuri;
@ -304,7 +300,6 @@ let monTableau = {
this.table[i] = data[0]; this.table[i] = data[0];
} else { } else {
let i = trouver_index(this.table, id); let i = trouver_index(this.table, id);
console.log('index ', i);
this.table.splice(i, 1); this.table.splice(i, 1);
} }
} else { } else {

View file

@ -196,12 +196,6 @@ function trouver_index(table, id) {
return i; return i;
} }
String.fromHtmlEntities = function (string) {
return (string + '').replace(/&#\d+;/gm, function (s) {
return String.fromCharCode(s.match(/\d+/gm)[0]);
});
};
var monTableau = { var monTableau = {
props: { props: {
tparpage: { tparpage: {
@ -308,7 +302,11 @@ var monTableau = {
}, },
methods: { methods: {
calculer_nameLocalStorage: function calculer_nameLocalStorage() { calculer_nameLocalStorage: function calculer_nameLocalStorage() {
return this.apiuri.match(/.*page=(.*)/)[1]; if (this.apiuri) {
return this.apiuri.match(/.*page=(.*)/)[1];
}
return 'a';
}, },
chargerJson: function chargerJson(id) { chargerJson: function chargerJson(id) {
var _this3 = this; var _this3 = this;