feat: Validation des elements d'une colonne via checkbox, on peut maintenant
choisir soit un action soit un formulaire
This commit is contained in:
parent
a112b1b8be
commit
8d5abb7acf
4 changed files with 77 additions and 19 deletions
|
@ -232,6 +232,15 @@ Concatener le filtrage dans l'url d'appel du json :
|
|||
<a class="btn" href="[(#URL_PAGE{commandes}|parametre_url{annee,2021})]">2021</a>
|
||||
```
|
||||
|
||||
## cellule checkbox
|
||||
Il est possible d'ajouter pour une colonne des checbox qui declencheront soit une action, soit l'appel d'un formulaire.
|
||||
1. il faut ajouter dans le header la cle checkbox (cf ex) pour definir l'url du payload de type action ou page= (formulaire)
|
||||
avec comme nom de premier parametre : data qui sera transformer en php via :
|
||||
```php
|
||||
$data = json_decode($data,true);
|
||||
```
|
||||
2. Puis la valeur de la cellule doit etre du type dataid-#ID_PATATE (cf ex)
|
||||
|
||||
|
||||
## Refs
|
||||
https://unpkg.com/browse/vue-next-select@2.10.4/
|
||||
|
|
|
@ -818,6 +818,14 @@ let monTableau = {
|
|||
},
|
||||
checkboxValider(head, url) {
|
||||
let that = this;
|
||||
console.log('head = ', head);
|
||||
console.log('url = ', url);
|
||||
let typeLien = 'page';
|
||||
if (url.includes('action=')) {
|
||||
typeLien = 'action';
|
||||
}
|
||||
// $.modalbox(url, data);
|
||||
if (typeLien === 'action') {
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: { data: this.Tcheckbox[head] },
|
||||
|
@ -825,6 +833,16 @@ let monTableau = {
|
|||
}).done(function () {
|
||||
that.chargerJson();
|
||||
});
|
||||
} else {
|
||||
const Tcheck = encodeURIComponent(JSON.stringify(this.Tcheckbox[head]));
|
||||
url += '&data=' + Tcheck;
|
||||
url += '&var_zajax=content';
|
||||
const data = {};
|
||||
data.onClose = () => {
|
||||
that.chargerJson();
|
||||
};
|
||||
$.modalbox(url, data);
|
||||
}
|
||||
},
|
||||
},
|
||||
template: `
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,8 +5,9 @@
|
|||
"id": "_",
|
||||
"titre": "titre",
|
||||
"nom": "Auteur",
|
||||
"texte": "texte",
|
||||
"date": "date",
|
||||
"texte": "texte",
|
||||
"checkbox_a_valider": "a valider",
|
||||
"statut": "statut"
|
||||
},
|
||||
"crayons":{
|
||||
|
@ -19,11 +20,17 @@
|
|||
"filtreCol" : {
|
||||
"statut" : "select",
|
||||
"titre": "input"
|
||||
}
|
||||
},
|
||||
"classes":{
|
||||
"titre": "toto",
|
||||
"email":"toto"
|
||||
}
|
||||
},
|
||||
"checkbox": {
|
||||
[(#REM)
|
||||
"realise": [(#URL_ACTION_AUTEUR{titi,0}|json_encode)]
|
||||
]
|
||||
"realise": [(#URL_PAGE{toto}|json_encode)]
|
||||
},
|
||||
},
|
||||
<BOUCLE_articles(ARTICLES){id_article?}{tout}{','}>
|
||||
[(#SET{statut,
|
||||
|
@ -37,6 +44,7 @@
|
|||
]
|
||||
</a>
|
||||
})]
|
||||
[(#SET{valider, dataid-#ID_PATATE})]
|
||||
|
||||
{
|
||||
"html": {
|
||||
|
@ -45,6 +53,7 @@
|
|||
"nom" : [(#NOM|json_encode)],
|
||||
"date" : [(#DATE|affdate{d/m/Y}|json_encode)],
|
||||
"texte": [(#VAL{<a class="modalbox" title="Détail" href="[(#URL_PAGE{gamutable_texte}|parametre_url{id_article,#ID_ARTICLE})]">[(#TEXTE|couper{10})]</a>}|json_encode)],
|
||||
"checkbox_a_valider": [(#DATE_REALISE|dateHumaine|sinon{#GET{valider}}json_encode)],
|
||||
"statut" : [(#GET{statut}|json_encode)]
|
||||
},
|
||||
"classes": {
|
||||
|
|
Loading…
Add table
Reference in a new issue