From edb85afd675c60c048f9c6cf726a5163f9197269 Mon Sep 17 00:00:00 2001 From: daisyonly <1241945585@qq.com> Date: Tue, 26 Aug 2014 17:36:37 +0800 Subject: [PATCH] add required in editorFactory and containerFactory add required in editorFactory and containerFactory --- .../script/scriptManager/containerFactory.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js index cfb1ca62..fe78bc68 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js @@ -22,9 +22,9 @@ ContainerFactory.prototype.createEditorContainer = function(header, id, containerInfo[i].name == ""; } if (containerInfo[i].children == null) { - + console.log(containerInfo[i]); this.appendEdtiors(container, containerInfo[i].label, - containerInfo[i].nameCN, containerInfo[i].name, + containerInfo[i].nameCN, containerInfo[i].required, containerInfo[i].name, containerInfo[i].paramTypeModel,containerInfo[i].value == null ?"":containerInfo[i].value); } else { $(container).append( @@ -39,29 +39,30 @@ ContainerFactory.prototype.createEditorContainer = function(header, id, }; -ContainerFactory.prototype.appendEdtiors = function(container, label, name, id, +ContainerFactory.prototype.appendEdtiors = function(container, label, name, required, id, editorInfo, value) { var editorFactory = new EditorFactory(); if (editorInfo.type.toLowerCase() == "field") { + console.log("required:"+required); $(container).append( - editorFactory.createField(label, name, editorInfo.size, id,value)); + editorFactory.createField(label, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "nfield") { $(container).append( editorFactory - .createMultiField(label, name, editorInfo.size, id,value)); + .createMultiField(label, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "table") { $(container).append( - editorFactory.createTable(label, name, editorInfo.cols, id,value)); + editorFactory.createTable(label, name, required, editorInfo.cols, id,value)); } else if (editorInfo.type.toLowerCase() == "file") { $(container).append( - editorFactory.createFile(lable, name, editorInfo.size, id,value)); + editorFactory.createFile(lable, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "date") { $(container).append( - editorFactory.createDate(label, name, editorInfo.size, id,value)); + editorFactory.createDate(label, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "select") { $(container).append( editorFactory.createSelect(label, name, editorInfo.size,