2015-12-03 12 views
0

J'ai un problème avec une forme fractionnée qui est attachée à un dhtmlxSidebar. Malheureusement, le dhtmlxEditor ne fonctionne pas de cette façon et n'est lu qu'en quelque sorte.Split dhtmlxForm attaché à dhtmlxSidebar

Voilà ma structure 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"}; 

Répondre

1

Peut être cette approche pourrait vous aider:

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