StandAlone editor: is there a way to edit one-to many join table

StandAlone editor: is there a way to edit one-to many join table

DocNCDocNC Posts: 24Questions: 6Answers: 0

Hello
I have to edit a one-to-many join,
(typical checkboxes case like ''https://editor.datatables.net/examples/advanced/joinArray.html'')
is it possible to use standalone editor to achieve that ?
thanks
Michel

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Could you clarify in what way you want to use the standalone Editor? Do you mean inside an Editor modal, or as part of another form, or individually show the checkboxes? I'm not quite clear on what the UI will be.

    Thanks,
    Allan

  • DocNCDocNC Posts: 24Questions: 6Answers: 0

    Sorry
    I mean inside of editor modal.
    here is the html i would like to use

    <div id="P_commercants" class="SA_panel panel" data-editor-id=":ID" data-Xeditor-key="id_organisation" data-Xeditor-db="commercants" data-editor-confname="commercants"> <dl> <dt> Nom :&nbsp;</dt> <dd data-editor-field='nom' >_____</dd> <dt> ST :&nbsp;</dt> <dd data-editor-field='statut_juridique' >_____</dd> <dt> ID :&nbsp;</dt> <dd data-editor-field='identification' >_____</dd> <dt> Activite :&nbsp;</dt> <dd data-editor-field='activite' >_____</dd> <dt> Date_creation :&nbsp;</dt> <dd data-editor-field='date_creation' >_____</dd> <dt> Descriptif :&nbsp;</dt> <dd data-editor-field='descriptif' >_____</dd> <dt> Familles :&nbsp;</dt> <dd data-editor-field='spip_mots[].id_mot' >_____</dd> </dl> </div>

    the Js build editor with init object :
    { "fields": [ { "label": "Nom", "name": "nom" }, { "label": "ST", "name": "statut_juridique" }, { "label": "ID", "name": "identification" }, { "label": "Activite", "name": "activite" }, { "type": "readonly", "displayFormat": "D/M/YYYY", "wireFormat": "YYYY-MM-DD", "label": "Date_creation", "name": "date_creation", "attr": { "disabled": true } }, { "label": "Descriptif", "name": "descriptif" }, { "name": "killdate", "type": "hidden" }, { "label": "Familles :", "name": "spip_mots[].id_mot", "type": "checkbox" } ], "ajax": "./?j=commercants", "table": null, }

    All fields seems ok, BUT
    <dd data-editor-field='spip_mots[].id_mot' >_____</dd>
    who never show the checkboxes.

    Thanks for you care
    Michel

  • DocNCDocNC Posts: 24Questions: 6Answers: 0
    edited May 2022

    Sorry for previous comment

    I mean inside of editor modal

    the Js build editor with this object :
    { "fields": [ { "label": "Nom", "name": "nom" }, { "label": "ST", "name": "statut_juridique" }, { "label": "ID", "name": "identification" }, { "label": "Activite", "name": "activite" }, { "type": "readonly", "displayFormat": "D/M/YYYY", "wireFormat": "YYYY-MM-DD", "label": "Date_creation", "name": "date_creation", "attr": { "disabled": true } }, { "label": "Descriptif", "name": "descriptif" }, { "name": "killdate", "type": "hidden" }, { "label": "Familles :", "name": "spip_mots[].id_mot", "type": "checkbox" } ], "ajax": "./?j=commercants", "table": null, }

    the editor is called
    editor.title("Modifier ") .buttons({ label: "Enregistrer", fn: function () { this.submit(); } }).edit('row_' + panel.data('editor-id'));

    All fields seems ok, BUT item Familles
    never show the checkboxes.

    Thanks for you care
    Michel

  • DocNCDocNC Posts: 24Questions: 6Answers: 0

    if this can help,
    server answer is
    { "data": [ { "DT_RowId": "row_11329", "nom": "SARL A FLEUR DE PEAU", "statut_juridique": "15", "identification": "", "activite": "commercant", "date_creation": "1980-01-01", "descriptif": "sqfsfqsqs", "spip_mots": [] } ], "options": { "spip_mots[].id_mot": [ { "label": "Naissance", "value": "34" }, { "label": "Noël", "value": "44" }, { "label": "S'cool", "value": "35" }, { "label": "jeunesse", "value": "32" } ] }, "files": [], "searchPanes": { "options": [] } }
    which sounds logical to me...

Sign In or Register to comment.