QRCode lib
This commit is contained in:
@ -13,6 +13,7 @@ class EdtRec
|
||||
constructor(caption)
|
||||
{
|
||||
this.uid=getUID();
|
||||
this.record_id=null;
|
||||
|
||||
this.win=new TWin();
|
||||
this.win.BuildGUI(pageX-10,pageY-10);
|
||||
@ -41,6 +42,9 @@ class EdtRec
|
||||
|
||||
ERec_mas[this.uid]=this;
|
||||
this.f_TypeName=""; //Имя редактируемого объекта (type->n attribute)
|
||||
|
||||
this.onInserted=null; //After insert row
|
||||
this.onUpdated=null; //After update row
|
||||
}
|
||||
|
||||
//Show progress bar
|
||||
@ -787,7 +791,8 @@ class EdtRec
|
||||
td = document.createElement('td');
|
||||
td.style.cssText="padding: 5px; vertical-align: bottom;";
|
||||
td.setAttribute("colspan", "2");
|
||||
if (this.record_id==-1) td.innerHTML='<label style="float: left; white-space: nowrap;"><input id="readd_'+this.uid+'" type="checkbox"> '+trt('Repeat_the_addition_of_the_entry')+'</label>';
|
||||
if (this.record_id==-1) td.innerHTML='<div id="add_plase_'+this.uid+'" style="float: left; white-space: nowrap;"><label><input id="readd_'+this.uid+'" type="checkbox"> '+trt('Repeat_the_addition_of_the_entry')+'</label></div>';
|
||||
else td.innerHTML='<div id="add_plase_'+this.uid+'" style="float: left; white-space: nowrap;"></div>';
|
||||
tr.appendChild(td);
|
||||
//let td = document.createElement('td');
|
||||
td.setAttribute("align","right");
|
||||
@ -1189,7 +1194,7 @@ class EdtRec
|
||||
let smallText = '';
|
||||
let pos1=fullText.indexOf('[[');
|
||||
let pos2=fullText.indexOf(']]');
|
||||
if(pos1>0 && pos2>0 && pos1<pos2) smallText=fullText.substring(pos1+2, pos2);
|
||||
if(pos1>=0 && pos2>=0 && pos1<pos2) smallText=fullText.substring(pos1+2, pos2);
|
||||
|
||||
if(fullText.indexOf("id456[[")>=0){ //Если есть идентификатор того что это перезапись
|
||||
let okFunc=()=>{
|
||||
@ -1507,22 +1512,23 @@ class EdtRec
|
||||
{ //Update the parent
|
||||
let typeNode=findFirstNode(node,"type");
|
||||
let typeName=typeNode.getAttribute("n");
|
||||
let id=typeNode.getAttribute("id");
|
||||
this.record_id=typeNode.getAttribute("id"); //let id=typeNode.getAttribute("id");
|
||||
if (this.opener!=null)
|
||||
{
|
||||
if(this.opener.f_TypeName==typeName) //It would be better to make an array of open windows then check for all and not just for the parent.
|
||||
{
|
||||
this.opener.sendFilter(id,-1); //Update data by filter with id records.
|
||||
this.opener.sendFilter(this.record_id,-1); //Update data by filter with id records.
|
||||
}
|
||||
}
|
||||
|
||||
let readd=document.getElementById("readd_"+this.uid);
|
||||
if(readd!==null && readd.checked){
|
||||
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",'',null,()=>this.win.Close());
|
||||
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",'',()=>{this.record_id=-1},()=>this.win.Close());
|
||||
}else
|
||||
{
|
||||
this.win.Close();
|
||||
}
|
||||
if(this.onInserted!=null) this.onInserted(this);
|
||||
};
|
||||
|
||||
//The data has been updated successfully now telling the parent to update the record.
|
||||
@ -1539,9 +1545,8 @@ class EdtRec
|
||||
}
|
||||
}
|
||||
this.win.Close();
|
||||
if(this.onUpdated!=null) this.onUpdated(this);
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Поле с галочкой (или галочками)
|
||||
|
||||
Reference in New Issue
Block a user