拆分dhtmlxForm附加到dhtmlxSidebar

时间:2015-12-03 15:51:42

标签: forms split sidebar dhtmlx

我遇到了一个附加到dhtmlxSidebar的拆分表单的问题。不幸的是,dhtmlxEditor不能以这种方式工作,只能以某种方式读取。

这是我的dhtmlxForm结构:

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"};

1 个答案:

答案 0 :(得分:1)

可能这种方法可以帮到你:

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;
}
});