String combo

This commit is contained in:
2023-03-13 08:51:51 +06:00
parent b8f655f69b
commit 4aa9eaa9d3
3 changed files with 92 additions and 12 deletions

View File

@ -1,7 +1,7 @@
//Copyright (C) Ivanov I.M. file created in 2008
//For find non english chars: [^\x00-\x7F]+
//Заглушки
//Stubs
function setPropVal(uid,id,c,p){
ERec_mas[uid].setPropVal(id,c,p);
}
@ -321,15 +321,42 @@ class EdtRec
let nList=findNode(nodeProp, "options");
if(nList!=null)
{
nodeProp.field = new TCheckboxListField(nodeProp.getAttribute("n"));
let nCheckbox = nList.firstChild;
while (nCheckbox!=null) {
if(nCheckbox.nodeName=="option") {
nodeProp.field.addCheckbox(nCheckbox.getAttribute("n"), nCheckbox.getAttribute("d"));
if(nList.getAttribute("selector")=="combo")
{
let select = document.createElement('select');
select.classList.add('DBMS');
select.style.cssText="width: 100%; height:22px; line-height: 22px;";
select.setAttribute("name",nodeProp.getAttribute("n"));
select.setAttribute("id","prop_"+this.uid+"_"+nodeProp.getAttribute("n"));
select.onchange = function(thiz,node){ return function()
{
thiz.onComboObjectChangeHandler(node);
};
}(this,nodeProp);
let nCheckbox = nList.firstChild;
while (nCheckbox != null) {
if (nCheckbox.nodeName == "option") {
let option = document.createElement('option');
option.setAttribute("value",nCheckbox.getAttribute("n"));
option.appendChild(document.createTextNode(nCheckbox.getAttribute("d")));
select.appendChild( option );
}
nCheckbox = nCheckbox.nextSibling;
}
nCheckbox = nCheckbox.nextSibling;
//select.setAttribute("value",value);// does not work because when creating no values in the list
newCell1.appendChild(select);
}else{
nodeProp.field = new TCheckboxListField(nodeProp.getAttribute("n"));
let nCheckbox = nList.firstChild;
while (nCheckbox != null) {
if (nCheckbox.nodeName == "option") {
nodeProp.field.addCheckbox(nCheckbox.getAttribute("n"), nCheckbox.getAttribute("d"));
}
nCheckbox = nCheckbox.nextSibling;
}
newCell1.appendChild(nodeProp.field.getDiv());
}
newCell1.appendChild(nodeProp.field.getDiv());
}else
{
let input = document.createElement('input');
@ -958,7 +985,7 @@ class EdtRec
let rec=new SRec();
rec.opener=this;
rec.create();
rec.create(null);
rec.f_State=1;
rec.f_PropName=nodeProp.getAttribute("n");
rec.f_Settings=settings;