87,914
社区成员
发帖
与我相关
我的任务
分享
obj={
config : undefined,
url : undefined,
retval : undefined,
checked : [],
checkedText : [],
......
processData:function(){
var data={};
data.divid=this.config.divid||'01';
data.type=this.config.type||'radio';
data.url =this.url;
data.mm = this;
var retval = window.showModalDialog(app.path+"/B.jsp", data, "center=yes;scrollbars=no;resizable=no;help=no;status=no;dialogTop=200; dialogLeft=300;dialogHeight=400px;dialogwidth=580px;");
},
confirm:function(retval){
this.retval = retval;
this.checkedText =retval.checkedText;
this.checked = retval.checked
......
},
};
var key=[],val=[];
function someOpers(){
data= window.dialogArguments;
key=data.mm.checked;
val=data.mm.chekcedText;
......
//对数组进行一些 push、remove的操作
......
}
function retValue(){
var checked = chktree.getChecked();
var checkedText = chktree.getCheckedText();
this.confirm({
checked : key,
checkedText : val,
});
window.close();
}
window.returnValue=objB
window.close();
var arr_new=data.mm.checked;
arr_new=data.mm.checked.slice(0);
for(var i=0;i<data.mm.checked.length;i++){
arr.push(data.mm.checked[i]);
}
function retValue(){
var checked = chktree.getChecked();
var checkedText = chktree.getCheckedText();
data.confirm({//=========变量是否调用错了?应该是checked和checkedText吧?
checked :checked /*key*/,
checkedText :checkedText /*val*/,
});
window.close();
}
processData:function(){
/*var data={};
data.divid=this.config.divid||'01';
data.type=this.config.type||'radio';
data.url =this.url;
data.mm = this;*/
//===========直接传递this就行,此时this==obj,何必多申明一个变量,而且divid和type都是obj的config中的属性,有点浪费了吧。。
var retval = window.showModalDialog(app.path+"/B.jsp", this, "center=yes;scrollbars=no;resizable=no;help=no;status=no;dialogTop=200; dialogLeft=300;dialogHeight=400px;dialogwidth=580px;");
}
var key=[],val=[];
function someOpers(){
data= window.dialogArguments;
key=data.checked;/////////
val=data.chekcedText; ////////
......
//对数组进行一些 push、remove的操作
......
}
function retValue(){
var checked = chktree.getChecked();
var checkedText = chktree.getCheckedText();
data.confirm({//=========
checked : key,
checkedText : val,
});
window.close();
}