This commit is contained in:
2021-09-13 20:49:01 +06:00
14 changed files with 3237 additions and 166 deletions

View File

@ -729,46 +729,46 @@ class SRec
}else
if (columnNode.getAttribute("vt")==="i4")
{
let table=document.createElement('table');
table.border=0;
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;";
let newRow=table.insertRow(0); //We add a row in the created table.
let newCell1 = newRow.insertCell(0);
newCell1.style.cssText="padding:0px;padding-right:1px;width:100%;";
let newCell2 = newRow.insertCell(1);
newCell2.style.cssText="padding:0px;padding-right:1px;height:100%;";
let newCell3 = newRow.insertCell(2);
newCell3.style.cssText="padding:0px;width:25px;height:100%;";
let opt=findNode(columnNode, "options");
if(opt!=null) //If combobox
{
let select = document.createElement('select');
select.style.cssText="width: 100%;";
select.setAttribute("name",columnNode.getAttribute("n"));
select.setAttribute("id", 'filter_' + this.uid + '_' + columnNode.getAttribute("n"));
opt=opt.firstChild
while(opt!=null)
{
if(opt.nodeName=="option")
{
let option = document.createElement("option");
option.setAttribute("value",opt.getAttribute("val"));
option.appendChild(document.createTextNode(opt.getAttribute("d")));
select.appendChild( option );
}
opt=opt.nextSibling;
}
td2.appendChild(select);
}else {
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
input.onkeydown=function(){ if(event.keyCode==13) event.keyCode=9; };
input.setAttribute("name",columnNode.getAttribute("n"));
if(columnNode.getAttribute("size")!=null)
input.setAttribute("maxlength",columnNode.getAttribute("size"),0);
input.setAttribute("value",value);
input.setAttribute("id",'filter_'+this.uid+'_'+columnNode.getAttribute("n"));
newCell1.appendChild( input );
let button = document.createElement('input');
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","+");
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
newCell2.appendChild( button );
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)+1; }}(input);
button = document.createElement('input');
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","-");
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)-1; }}(input);
newCell3.appendChild( button );
td2.appendChild( table );
button = document.createElement('input');
button.className = 'button-secondary';
button.setAttribute("type", "button");
button.setAttribute("value", "-");
button.style.cssText = "height:100%;width:22px;margin:0px;padding:0px;";
button.onclick = function (inp) {
return function () {
inp.value = getIntVal(inp.value) - 1;
}
}(input);
newCell3.appendChild(button);
td2.appendChild(table);
}
}else
if (columnNode.getAttribute("vt")==="f8")
{
@ -1050,7 +1050,7 @@ class SRec
th.style.cssText='width: 1%;';
tr.appendChild(th);
th=document.createElement('th');
th.appendChild( document.createTextNode('Del'));
th.appendChild( document.createTextNode(trt('Del')));
th.title = trt('Invert_selection');
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; };
@ -1557,7 +1557,7 @@ class SRec
{
let nodeType=findFirstNode(node, "type");
let typeName=nodeType.getAttribute("n");
id=nodeType.getAttribute("id");
let id=nodeType.getAttribute("id");
deleteHTML(id+'_'+this.uid);
//Rebuild sequential numbering of rows (first column)
let theTable = document.getElementById('thetable'+this.uid); //data table