Подправил выбор при редактировании. А также переделал в класс окно выбора.

This commit is contained in:
2020-02-28 17:15:05 +06:00
parent cb3714d3b0
commit 0fba5eac2a
3 changed files with 282 additions and 281 deletions

View File

@ -511,7 +511,7 @@ class EdtRec
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;height:100%;";
button.onclick=this.onSelObj(nodeProp.getAttribute("ot"),nodeProp.getAttribute("n"));
button.onclick=function(thiz,val1,val2){return function(){thiz.SelectObjects(val1,val2);};}(this,nodeProp.getAttribute("ot"),nodeProp.getAttribute("n"));
newCell2.appendChild(button);
td2.appendChild( table );
@ -578,7 +578,7 @@ class EdtRec
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
button.onclick=this.onSelObj(nodeProp.getAttribute("ot"),nodeProp.getAttribute("n"));
button.onclick=function(thiz,val1,val2){return function(){thiz.SelectObjects(val1,val2);};}(this,nodeProp.getAttribute("ot"),nodeProp.getAttribute("n"));
newCell2.appendChild(button);
td2.appendChild( table );
@ -883,26 +883,23 @@ class EdtRec
win.setContent(str);
};
onSelObj(val1,val2)
//request data to fill the Object Filter
//The result can fill the filter field with complete information or a window with a further choice of the value
SelectObjects(typeName,propname)
{
var obj=this;
return function()
let rec=new SRec();
rec.opener=this;
rec.create();
rec.f_State=1;
rec.f_PropName=propname;
rec.f_TypeName=typeName;
rec.win.setLeftTop(pageX-250,pageY-10);
rec.win.setParent(this.win);
if(rec.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="0"><type n="'+rec.f_TypeName+'"></type></metadata>'))
{
var rec=new SRec();
rec.create();
//rec.f_Settings=xmlString;
rec.f_State='0';
rec.f_TypeName=val1;
rec.f_PropName=val2;
rec.win.setLeftTop(pageX-250,pageY-10);
rec.win.setParent(obj.win);
if(rec.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="0"><type n="'+rec.f_TypeName+'"></type></metadata>'))
{
obj.showProgressBar();
}
//win.selObj(val1,val2);
};
};
rec.showProgressBar();
}
}
//Call the ShowRecord.html window with the parameters for the filter (not just the object name).
callWindow(nodeProp)