Передача фильтра при выборке по кнопке "..."

This commit is contained in:
2022-12-21 16:48:23 +06:00
parent f2e1596e30
commit b8f655f69b
3 changed files with 79 additions and 72 deletions

View File

@ -355,7 +355,7 @@ class EdtRec
button.setAttribute("value","...");
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
button.onclick=function(thiz,nodeProp){ return function(){
thiz.callWindow(nodeProp);
thiz.callWindowF(nodeProp);
};}(this,nodeProp);
newCell2.appendChild( button );
@ -529,11 +529,11 @@ 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=function(thiz,val1,val2){
button.onclick=function(thiz,val){
return function(){
thiz.SelectObjects(val1,val2);
thiz.SelectObjects(val);
};
}(this,nodeProp.getAttribute("ot"),nodeProp.getAttribute("n"));
}(this,nodeProp.getAttribute("n"));
newCell2.appendChild(button);
td2.appendChild( table );
@ -601,7 +601,7 @@ class EdtRec
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
button.onclick=function(thiz,val1,val2){return function(){thiz.SelectObjects(val1,val2);};}(this,nodeProp.getAttribute("ot"),nodeProp.getAttribute("n"));
button.onclick=function(thiz,val){return function(){thiz.SelectObjects(val);};}(this,nodeProp.getAttribute("n"));
newCell2.appendChild(button);
td2.appendChild( table );
@ -918,39 +918,22 @@ class EdtRec
//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)
SelectObjects(propname)
{
let rec=new SRec();
rec.opener=this;
rec.create();
rec.f_State=1;
rec.f_PropName=propname;
rec.f_TypeName=typeName;
rec.win.setCenter(); //rec.win.setLeftTop(pageX-250,pageY-10);
rec.win.setParent(this.win);
let settings="";
let node=findNodeOnPath(this.nodeMetadata, "type/properties/prop[@n='"+propname+"']/type");
if(node!=null){
settings=getXMLNodeSerialisation(node);
}
rec.callData(rec.f_TypeName,settings);
/*if(rec.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="0"><type n="'+rec.f_TypeName+'"></type></metadata>'))
{
rec.showProgressBar();
}*/
let nodeProp=findNodeOnPath(this.nodeMetadata, "type/properties/prop[@n='"+propname+"']");
if(nodeProp!=null)
this.callWindowF(nodeProp);
}
//Call the ShowRecord window with the parameters for the filter (not just the object name).
callWindow(nodeProp)
callWindowF(nodeProp)
{
let xmlString="";
let settings="";
let TypeName="";
let nT=findNode(nodeProp, "type");
if(nT!=null)
{
xmlString=getXMLNodeSerialisation(nT);
settings=getXMLNodeSerialisation(nT);
TypeName = nT.getAttribute("n");
}else
{
@ -959,23 +942,26 @@ class EdtRec
//Write to XML string from GUI
while(true)
{
let sub1=BeforeFirst(xmlString,"${");
let sub1=BeforeFirst(settings,"${");
if(sub1==null) break;
let sub2=AfterFirst(xmlString,"}");
let sub2=AfterFirst(settings,"}");
if(sub2==null) break;
let val=BeforeFirst(AfterFirst(xmlString,"${"),"}");
let val=BeforeFirst(AfterFirst(settings,"${"),"}");
let obj=document.getElementById("prop_"+this.uid+"_"+val);
if(obj!=null){
xmlString=sub1+obj.value+sub2;
settings=sub1+obj.value+sub2;
}else{
xmlString=sub1+sub2;
settings=sub1+sub2;
}
}
let rec=new SRec();
rec.opener=this;
rec.create();
rec.f_Settings=xmlString;
rec.f_State=1;
rec.f_PropName=nodeProp.getAttribute("n");
rec.f_Settings=settings;
rec.f_TypeName=TypeName;
rec.win.setLeftTop(pageX-250,pageY-10);
rec.win.setParent(this.win);
@ -1247,11 +1233,11 @@ class EdtRec
let node=findFirstNodeOnAttribute(this.nodeMetadata,'prop','n',prop_id);
if(node!==null)
{
getCdata(node).nodeValue=id;
let name=node.getAttribute("FieldCaption");
getCdata(node).nodeValue=id;
//We request data from the server to fill in the comments on the id of the record.
let prop=document.getElementById("prop_"+this.uid+"_"+prop_id);
if(prop!==null) prop.value=id;
if(prop!==null) prop.value = id;
//Request a comment on the record id from the server
let xml = '';
if(filter!=''){