Search code examples
formssplitsidebardhtmlx

Split dhtmlxForm attached to dhtmlxSidebar


I have a problem with a split-form which is attached to a dhtmlxSidebar. Unfortunately the dhtmlxEditor doesn’t work that way and is read only somehow.

Here's my dhtmlxForm structure:

var formData_technik = [
{ type: "settings", position: "label-left"},
{ type: "block", id: "eintragung", inputWidth: 650, list: [
{ type: "combo", label: "Studio: ", inputWidth: 200, labelWidth: 60, name: "technik_studio", required: "true" },
{ type: "input", label: "Problem", name: "technik_problem", rows: "1", selected: "true", labelWidth: 60, inputWidth: 450, required: "true", note: {text: "kurze Beschreibung"}},
{ type: 'editor', name: 'technik_detail', label: 'Problembeschreibung', labelWidth: 400, inputWidth: 620, inputHeight: 240, value: "" },
{ type: "combo", label: "Eingetragen von", name: "technik_user", inputWidth: 200, labelWidth: 70, disabled: true }
]},
{ type: "block", id: "bearbeitet", list: [
{ type: "checkbox", label: "Problem behoben", name: "technik_behoben", inputWidth: 20, position: "label-right" },
{ type: "combo", label: "Behoben von", name: "technik_behobenvon", inputWidth: 200, labelWidth: 90, disabled: true },
{ type: "calendar", label: "Behoben am", name: "technik_behobenwann", dateFormat: "%d.%m.%Y %H:%i", serverDateFormat: "%Y-%m-%d %H:%i:%s", enableTime: "true", labelWidth: 90, inputWidth: 120, disabled: true },
{ type: 'editor', name: 'technik_behobenkommentar', label: 'Problembeschreibung', labelWidth: 400, inputWidth: 620, inputHeight: 240, value: "" }
]}
];
var initValues = {technik_behobenkommentar: "123 234 345"};

Solution

  • May be this approach could help you:

    mySidebar = new dhtmlXSideBar({ parent: "sidebarObj", icons_path: "win_16x16/", width: 160, items: [ {id: "recent", text: "Recent", icon: "recent.png", selected: true}, {id: "desktop", text: "Desktop", icon: "desktop.png"}] });
    myForm = mySidebar.cells("recent").attachForm(formData_technik);
    mySidebar.cells("desktop").attachObject("bearbeitet");
    mySidebar.attachEvent("onSelect", function(id){
        if (id == "recent" || id == "desktop") {
            var editorId = {recent:"technik_detail", desktop: "technik_behobenkommentar"}[id];
    myForm.getEditor(editorId)._prepareContent(true);
    myForm.setItemValue(editorId, initValues[editorId]);
    initValues[editorId] = null;
    }
    });