Cant fill editor fields with a standalone panel...

Cant fill editor fields with a standalone panel...

DocNCDocNC Posts: 24Questions: 6Answers: 0

I try to edit some panels with editor.

my html is:

<div id="P_orga" class="SA_panel panel" data-editor-id="row_1109" data-editor-key="id_organisation" data-editor-db="orga">
<dl>

<dt> Nom :&nbsp;</dt>

<dd data-editor-field="nom" data-editor-value="CE CAFAT">CE CAFAT</dd>
<dt> ST :&nbsp;</dt>

<dd data-editor-field="statut_juridique" data-editor-value="SO">SO</dd>
<dt> ID :&nbsp;</dt>

<dd data-editor-field="identification" data-editor-value="CE">CE</dd>
<dt> Activite :&nbsp;</dt>

<dd data-editor-field="activite" data-editor-value="client">client</dd>
<dt> Date_creation :&nbsp;</dt>

<dd data-editor-field="date_creation" data-editor-value="2015-02-09">2015-02-09</dd>
<dt> Descriptif :&nbsp;</dt>

<dd data-editor-field="descriptif" data-editor-value="CE">CE</dd></dl>
</div>

the javascript is obvious also:

$(kSelect).on('click', '[data-editor-field]', function (event) {
       panel = $(this).closest(".SA_panel")
        db = panel.data("editor-db");
        editor = window.CCCdata.GlobDT[db].editor; // editor is stored in global data
        editor.edit(this);
    });

The wole editors fields BUT the date, appears empty when editor opens.
modifying data-editor-id="row_1109" to data-editor-id="1109"doenst help at all.

Im a bit lost on the matter, if somebody could help please.

Michel from New Caledonia

Answers

  • DocNCDocNC Posts: 24Questions: 6Answers: 0

    Sorry
    The wole editors fields appears empty when editor opens.
    the date is set to a default value.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi Michel,

    Could you give me a link to your page so I can debug it please?

    Thanks,
    Allan

  • DocNCDocNC Posts: 24Questions: 6Answers: 0

    yes alan i will build a debug page for that

  • DocNCDocNC Posts: 24Questions: 6Answers: 0

    Ok my mistake (partly).
    editor.edit(this);seems bad, better
    editor.edit('row_'+ panel.data('editor-id'));

    For some reason, panel.data return id and not "row_id";

    leads to this code i f somebody interested:

        $(kSelect).on('click', '[data-editor-field]', function (event) {
            panel = $(this).closest(".SA_panel")
            db = panel.data("xeditor-db");
            let editor = window.CCCdata.GlobDT[db].editor;
            editor.buttons({
                label: "Save",
                fn: function () { this.submit(); }
            }).edit('row_' + panel.data('editor-id'));
        });
    
Sign In or Register to comment.