feat: pour les cellules où les crayons sont branchés sur une table annexe (= différente de la table principale qui fournit l'id de la ligne), utiliser la valeur du champ crayons pour transmettre l'id de la table annexe à éditer. Ce qui donne :
crayons : { nom_du_champ : id_table_annexe }
This commit is contained in:
parent
4a0ffef53e
commit
828c892b03
3 changed files with 165 additions and 37 deletions
|
@ -675,7 +675,8 @@ let monTableau = {
|
|||
let to = page * parPage;
|
||||
return tableau.slice(from, to);
|
||||
},
|
||||
afficher_crayons(name, id) {
|
||||
afficher_crayons(name, l) {
|
||||
let id = l.crayons !== undefined && l.crayons[name] !== undefined ? l.crayons[name] : l.html.id;
|
||||
if (Object.keys(this.crayons).indexOf(name) !== -1) {
|
||||
return `crayon ${this.crayons[name]}-${name}-${id}`;
|
||||
}
|
||||
|
@ -969,7 +970,7 @@ let monTableau = {
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="l in tableau" :key="l.html.id" :class="selectTr.indexOf(l.html.id) !== -1 ? 'select' : ''" >
|
||||
<td v-for="(td,name, i) in l.html" :key="'td_'+i" :class="[afficher_crayons(name, l.crayons !== undefined && l.crayons[name] !== undefined ? l.crayons[name] : l.html.id), name, classes[name], l.classes !== undefined ? l.classes[name] : '']" @click="selectLigne(l.html.id,name)">
|
||||
<td v-for="(td,name, i) in l.html" :key="'td_'+i" :class="[afficher_crayons(name, l), name, classes[name], l.classes !== undefined ? l.classes[name] : '']" @click="selectLigne(l.html.id,name)">
|
||||
<div v-if="checkbox[name] !== undefined">
|
||||
<label v-if="td.split('-')[0] === 'dataid'">
|
||||
<input type='checkbox' v-model='Tcheckbox[name]' :value="td.split('-')[1]">
|
||||
|
|
188
js/gamutable.js
188
js/gamutable.js
File diff suppressed because one or more lines are too long
|
@ -4,12 +4,14 @@
|
|||
"header":{
|
||||
"id": "_",
|
||||
"titre": "titre",
|
||||
"nom": "Auteur",
|
||||
"texte": "texte",
|
||||
"date": "date",
|
||||
"statut": "statut"
|
||||
},
|
||||
"crayons":{
|
||||
"titre" : "article"
|
||||
"titre" : "article",
|
||||
"nom": "auteur"
|
||||
},
|
||||
"ordreCol" : {
|
||||
"titre" : "desc",
|
||||
|
@ -40,6 +42,7 @@
|
|||
"html": {
|
||||
"id": #ID_ARTICLE,
|
||||
"titre" : [(#TITRE|json_encode)],
|
||||
"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)],
|
||||
"statut" : [(#GET{statut}|json_encode)]
|
||||
|
@ -47,9 +50,13 @@
|
|||
"classes": {
|
||||
"texte": [(#STATUT|concat{-}|concat{#ID_ARTICLE}|json_encode)]
|
||||
},
|
||||
"crayons": {
|
||||
"nom": #ID_AUTEUR
|
||||
},
|
||||
"search": {
|
||||
"id": #ID_ARTICLE,
|
||||
"titre" : [(#TITRE|json_encode)],
|
||||
"nom" : [(#NOM|json_encode)],
|
||||
"date" : [(#DATE|affdate{U}|json_encode)],
|
||||
"texte": [(#TEXTE|couper{10}|json_encode)],
|
||||
"statut" : [(#STATUT|json_encode)]
|
||||
|
|
Loading…
Add table
Reference in a new issue