Добавил функцию по удалению всех дочерних элементов.

This commit is contained in:
Igor I
2024-02-07 08:29:24 +06:00
parent e2573c364c
commit 6440cfc419
2 changed files with 10 additions and 3 deletions

View File

@ -1237,7 +1237,7 @@ class SRec
let tr = document.createElement('tr');
tr.onmouseover=function(){ this.style.backgroundColor="var(--btn-color2)"; };
tr.onmouseout=function(val1,val2){return function(){val1.style.backgroundColor=val2;}}(tr,bgColor);
tr.setAttribute("id",id+'_'+this.uid);
tr.setAttribute("id",''+id+'_'+this.uid);
tr.style.backgroundColor=bgColor;
//sequential record number
@ -1281,7 +1281,7 @@ class SRec
else textNode=document.createTextNode("");
//td.setAttribute("id",id+this.masCL[colN].getAttribute("n")); //so that you can identify each record when you update
td.setAttribute("id",id+this.masCL[colN].n); //so that you can identify each record when you update
td.setAttribute("id",""+id+"_"+this.masCL[colN].getAttribute("n")); //so that you can identify each record when you update
td.appendChild(textNode);
//if in the metadata for this column there is a reference object then add a link
if (this.masCT[colN]!=null)
@ -1473,7 +1473,7 @@ class SRec
let pos=this.getColN(col);
if(pos>=0){
for(let i=0;i<this.f_nodeData.data.length;i++){
if(this.f_nodeData.data[i].id=id){
if(this.f_nodeData.data[i].id==id){
return this.f_nodeData.data[i].row[pos];
}
}

View File

@ -3,6 +3,13 @@
//var g_translations = {'':''};
function removeChild(parent){
if(parent==null) return;
while (parent.firstChild) {
parent.removeChild(parent.firstChild);
}
}
//Массив g_translations подгружается отдельно
function trt(key)
{