//codigo incrustado control_data.asp /************************************** * * * ***************************************/ function listObject(pname,pfields,pdata){ this.name=pname; this.editmode=false; this.fieldsSource=pfields; this.blankfields = new Array() try{ var adoRs = new ActiveXObject("adodb.recordset"); }catch (e){alert(e.description)} var objectAsosiates=new Array(); this.init=function(){for (var i in pfields){this.blankfields[i]="";adoRs.Fields.append (pfields[i],200,8000);}adoRs.CursorLocation=3;adoRs.CursorType=3;adoRs.LockType=4;adoRs.open();for (var i in pdata ){adoRs.AddNew(pfields,pdata[i]);}adoRs.MoveFirst()}; this.edit=function(){this.editmode=!this.editmode;this.updateAsociates2()} this.isedit=function(){return this.editmode} this.close=function(){adoRs.close()}; this.movenext=function(){adoRs.MoveNext();this.updateAsociates2()}; this.movefirst=function(){adoRs.MoveFirst();this.updateAsociates2()}; this.movelast=function(){adoRs.MoveLast();this.updateAsociates2()} this.movepreview=function(){adoRs.MovePreview();this.updateAsociates2()}; this.sort=function(pcriterial){adoRs.sort=(pcriterial);this.updateAsociates()}; this.filter=function(pcriterial){adoRs.filter=(pcriterial);this.movefirst();this.updateAsociates()}; this.fields=function(){return adoRs.fields}; this.fieldscount=function(){return adoRs.fields.count}; this.field=function(pfield){return adoRs.fields(pfield)}; this.insertrow=function(pdata){adoRs.addNew (this.fieldsSource,pdata);this.updateAsociates()}; this.addrow=function(pdata){adoRs.MoveLast();adoRs.addNew (this.fieldsSource,this.blankfields);adoRs.MoveLast();this.edit();}; this.count=function(){return (adoRs.RecordCount)}; this.eof=function(){return adoRs.EOF}; this.addAsociates=function (pobject){objectAsosiates[objectAsosiates.length] = pobject}; this.updateAsociates=function(){for (var i in objectAsosiates){if(objectAsosiates[i].classname=="grid")objectAsosiates[i].paint()/*; else objectAsosiates[i].selectrow();*/}}; this.updateAsociates2=function(){ for (var i in objectAsosiates){ try{ if(objectAsosiates[i].classname!="grid")objectAsosiates[i].paint() /*; else objectAsosiates[i].selectrow();*/ }catch(e){} } }; this.updateAsociates3=function(){ for (var i in objectAsosiates){ try{ objectAsosiates[i].paint() }catch(e){} } }; this.updaterow=function(){ try{ for (var i =1;i< this.fieldscount();i++) { for (var n in objectAsosiates){ if(objectAsosiates[n].name==this.fields()(i).name) { this.fields()(i).value=objectAsosiates[n].getvalue() } } } this.updateAsociates3() }catch(e){alert (e.description)} this.edit(); }; this.showAsociates=function(){var stri="";for (var i in objectAsosiates){stri+=objectAsosiates[i].objectname+"\r\n"}alert (stri);}; this.setposition=function(ppostion){if (this.isedit())return;adoRs.AbsolutePosition=ppostion;this.updateAsociates2()}; this.getrow=function(){return adoRs.AbsolutePosition}; this.deleterow=function(){try{adoRs.Delete()}catch(e){alert (e.description)};this.movefirst();this.updateAsociates()} this.cancel=function() {this.deleterow()} this.init(); } //codigo incrustado control_grid.asp /************************************** * * * ***************************************/ function addpro(provalue,proname){return ((provalue)?proname+"='"+provalue+"'":"")}; function addprocss(provalue,proname){return ((provalue)?proname+":"+provalue:"")}; function gridControl (parg) { this.container=parg.container var customValue this.ds=parg.datasource; this.classname="grid" this.evalheader=""; this.evalrowdata=""; this.widthLength=""; this.lastselectrow=null; this.columnclick=null this.name=parg.name this.objectclick=null this.setclickedcolumn=function(pobj,pcolumn) { this.columnclick =pcolumn this.objectclick=pobj } this.getclickedcolumn=function() { return this.columnclick+0+1 } this.getclickedobject=function() { return this.objectclick } this.header=function (){ return this.evalheader }; this.setposition=function(pobj,pposition){ if (this.ds.isedit())return; if (this.lastselectrow)this.lastselectrow.className=""; pobj.className="selectrow"; this.lastselectrow=pobj; parg.datasource.setposition(pposition); if (this.click) this.click(); } this.selectrow = function (){ /* if (this.ds.isedit())return; if (this.lastselectrow)this.lastselectrow.className=""; pobj.className="selectrow"; this.lastselectrow=pobj; */ } this.rowdata=null; this.dbclick=null; this.click=null; this.custom1=null this.custom2=null this.custom3=null this.custom4=null this.custom5=null this.custom6=null this.custom7=null this.custom8=null this.custom9=null this.custom10=null if (parg.click) this.click=parg.click; if (parg.dbclick) this.dbclick=parg.dbclick; if (parg.custom1) this.custom1=parg.custom1; if (parg.custom2) this.custom2=parg.custom2; if (parg.custom3) this.custom3=parg.custom3; if (parg.custom4) this.custom4=parg.custom4; if (parg.custom5) this.custom5=parg.custom5; if (parg.custom6) this.custom6=parg.custom6; if (parg.custom7) this.custom7=parg.custom7; if (parg.custom8) this.custom8=parg.custom8; if (parg.custom9) this.custom9=parg.custom9; if (parg.custom10) this.custom10=parg.custom10; var fieldList=parg.fields,stroption="",strrow="",widthLength=0; for (var i in fieldList){ this.evalheader+="
"+objds.field(parg.list.view)+" | " objds.movenext(); } str +="
"+objds.field(parg.list.view)+" | " objds.movenext(); } str +="
"
str +=(item.required)?"(*)":""
str +=item.label + " "
if (odata.showcomment=="label") str +=(item.comment)?" "+item.comment:"" if (odata.showcomment!="under") { str +=" | "
}else {
str +=" " } if (odata.showcomment=="top") str +=(item.comment)?item.comment+" ":"" document.write (str);str=""; //objdata[objdata.length]=new nvoInput(odata,item) this.objects[this.objects.length]=new nvoInput(odata,item) if (odata.showcomment=="down"||odata.showcomment=="under") str +=(item.comment)?" "+item.comment:" " str +=" | "
if (odata.showcomment=="third") str +=""+((item.comment)?item.comment:" ")+" | " if (odata.columnsAcross>1) { if (rodd==(odata.columnsAcross -1)) { str +="