Наследование 2

This commit is contained in:
Igor I
2024-03-25 20:27:33 +05:00
parent beea8a48e8
commit dd0a3f17ea
3 changed files with 13 additions and 5 deletions

View File

@ -8,10 +8,11 @@ function setPropVal(uid,id,c,p){
var ERec_mas = new Array(); //List of all ERec objects (TODO then you better come up with something). var ERec_mas = new Array(); //List of all ERec objects (TODO then you better come up with something).
class EdtRec class EdtRec extends TWin
{ {
constructor(caption) constructor(caption,dialog,path)
{ {
super(dialog,path);
this.uid=getUID(); this.uid=getUID();
this.record_id=null; this.record_id=null;
@ -19,6 +20,7 @@ class EdtRec
this.win.BuildGUI(pageX-10,pageY-10); this.win.BuildGUI(pageX-10,pageY-10);
this.win.setSize("500px","150px"); this.win.setSize("500px","150px");
this.win.setContent('<div id="eDiv'+this.uid+'" style="width: 100%; /*height: 100%;*/ position: relative;"></div>'); this.win.setContent('<div id="eDiv'+this.uid+'" style="width: 100%; /*height: 100%;*/ position: relative;"></div>');
this.win.obj=this;
let eDiv=document.getElementById('eDiv'+this.uid); let eDiv=document.getElementById('eDiv'+this.uid);
eDiv.innerHTML = '<table style="width:100%;height:100%"><tr><td style="vertical-align:middle;background-color:#F1F1F1"><center><IMG src="../resources/metadata/dbms/images/loading.gif"></center></td></tr></table>' eDiv.innerHTML = '<table style="width:100%;height:100%"><tr><td style="vertical-align:middle;background-color:#F1F1F1"><center><IMG src="../resources/metadata/dbms/images/loading.gif"></center></td></tr></table>'
@ -26,7 +28,6 @@ class EdtRec
this.caption=caption; this.caption=caption;
if(this.caption!='') if(this.caption!='')
this.win.setCaption(this.caption); this.win.setCaption(this.caption);
this.win.obj=this;
this.win.hide(false); this.win.hide(false);
this.name="name"+this.uid; this.name="name"+this.uid;

View File

@ -13,8 +13,9 @@ var SRec_mas = new Array(); //List of all objects "EdtRec" (then something bette
class SRec extends TWin class SRec extends TWin
{ {
constructor() constructor(dialog,path)
{ {
super(dialog,path);
this.win=null; this.win=null;
this.rwin=null; this.rwin=null;
@ -45,6 +46,11 @@ class SRec extends TWin
this.onUpdate=null; //For call set function this.onUpdate=null; //For call set function
this.onInsert=null; //For call set function this.onInsert=null; //For call set function
//TODO сделать наследование из класса TWin
this.parent=null; //родительское окно
this.childs=new Array(); //Подчинёные окна
} }
applyReq(req,fn,node,xmldoc) applyReq(req,fn,node,xmldoc)

View File

@ -1373,6 +1373,8 @@ class TWin
{ {
constructor(dialog,path) constructor(dialog,path)
{ {
this.uid=getUID(); //Уникальныйидентификатор
this.dialog=dialog; //Показывать окно как диалог (без возможности изменения размеров) this.dialog=dialog; //Показывать окно как диалог (без возможности изменения размеров)
if(typeof path !== 'undefined') if(typeof path !== 'undefined')
this.path=path; this.path=path;
@ -1399,7 +1401,6 @@ class TWin
this.ca=null; this.ca=null;
this.co=null; this.co=null;
this.shadow = false; //Показывать ли тень вокруг окошка this.shadow = false; //Показывать ли тень вокруг окошка
this.uid=getUID(); //Уникальныйидентификатор
this.pBarCnt=0; //Прогресс бар this.pBarCnt=0; //Прогресс бар
this.pBarDiv=null; //Прогресс бар this.pBarDiv=null; //Прогресс бар