modify createFeild and createMultiField function in plugin-new.js
This commit is contained in:
parent
657b7a5a5b
commit
775d3a5569
|
@ -316,6 +316,38 @@ function createMultiField(label, name, size, behaviorIndex) {
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
size = 20;
|
size = 20;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
var divNode=document.createElement("div");
|
||||||
|
var p=document.createElement("p");
|
||||||
|
var labelNode=document.createTextNode(name+":"+label);
|
||||||
|
var div=document.createElement("div");
|
||||||
|
var addFieldButton=document.createElement("button");
|
||||||
|
var addFieldNode=document.createTextNode("Add Field");
|
||||||
|
var removeFieldButton=document.createElement("button");
|
||||||
|
var removeFieldNode=document.createTextNode("RemoveAll");
|
||||||
|
var br=document.createElement("br");
|
||||||
|
var table=document.createElement("table");
|
||||||
|
|
||||||
|
$(divNode).attr("class","MultiField sample_frame");
|
||||||
|
$(divNode).attr("class", behaviorIndex+ "_"+ name);
|
||||||
|
$(div).attr("class","sample_sub_frame");
|
||||||
|
$(addFieldButton).attr("type","submit");
|
||||||
|
$(addFieldButton).attr("onClick","addField("+ size+ ","+ behaviorIndex+ ");");
|
||||||
|
$(removeFieldButton).attr("type","submit");
|
||||||
|
$(removeFieldButton).attr("onClick","removeField()");
|
||||||
|
$(table).attr("id","addFieldTable_"+behaviorIndex);
|
||||||
|
|
||||||
|
p.appendChild(labelNode);
|
||||||
|
addFieldButton.appendChild(addFieldNode);
|
||||||
|
removeFieldButton.appendChild(removeFieldNode);
|
||||||
|
div.appendChild(addFieldButton);
|
||||||
|
div.appendChild(removeFieldButton);
|
||||||
|
div.appendChild(br);
|
||||||
|
div.appendChild(table);
|
||||||
|
divNode.appendChild(p);
|
||||||
|
divNode.appendChild(div);
|
||||||
|
return $(divNode).html();
|
||||||
|
*/
|
||||||
var multiFieldHTML = "<div class='MultiField sample_frame' id='"
|
var multiFieldHTML = "<div class='MultiField sample_frame' id='"
|
||||||
+ behaviorIndex
|
+ behaviorIndex
|
||||||
+ "_"
|
+ "_"
|
||||||
|
@ -328,7 +360,8 @@ function createMultiField(label, name, size, behaviorIndex) {
|
||||||
+ size
|
+ size
|
||||||
+ ","
|
+ ","
|
||||||
+ behaviorIndex
|
+ behaviorIndex
|
||||||
+ ");'>Add Field</button><button type='submit' onClick='removeField();'>RemoveAll</button><br><table id='addFieldTable_"
|
+ ");'>Add Field</button><button type='submit' onClick='removeField();'>RemoveAll</button>"
|
||||||
|
+"<br><table id='addFieldTable_"
|
||||||
+ behaviorIndex + "'></table></div></div>";
|
+ behaviorIndex + "'></table></div></div>";
|
||||||
return multiFieldHTML;
|
return multiFieldHTML;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue