/**************************************************************************************************************************
方法 : mylist_ListView 列表控件
参数 : container 父容器,vs_title 标题
**************************************************************************************************************************/
function mylist_ListView(container,vs_title){
this.Container = container; //容器
this.Values = new ActiveXObject("Scripting.Dictionary");
this.SelectedIndex = -1; //选择指定行
this.SelectItem = function(){
if (this.SelectedIndex < 0)
return;
var vo_tr = this.TB.rows[this.SelectedIndex];
if (vo_tr != null){
vo_tr.className = "menu_Select";
mylist_Config.CurItem = vo_tr.tag;
mylist_Config.CurTr = vo_tr;
}
}
//选择列表
this.TB.onmousedown = function(){
var vo_tr = window.event.srcElement;
if(vo_tr.tagName == "TABLE")
return;
while(vo_tr.tagName != "TR"){
vo_tr = vo_tr.parentElement;
if(vo_tr.tagName == "TABLE")
return;
} if(mylist_Config.CurTr != null)
mylist_Config.CurTr.className = "menu_UnSelect";
this.SelectedIndex = vo_tr.rowIndex;
this.SelectItem();
}
}
红色标准部分是调用方法的部分,提示“对象不支持此属性或方法”
方法 : mylist_ListView 列表控件
参数 : container 父容器,vs_title 标题
**************************************************************************************************************************/
function mylist_ListView(container,vs_title){
this.Container = container; //容器
this.Values = new ActiveXObject("Scripting.Dictionary");
this.SelectedIndex = -1; //选择指定行
this.SelectItem = function(){
if (this.SelectedIndex < 0)
return;
var vo_tr = this.TB.rows[this.SelectedIndex];
if (vo_tr != null){
vo_tr.className = "menu_Select";
mylist_Config.CurItem = vo_tr.tag;
mylist_Config.CurTr = vo_tr;
}
}
//选择列表
this.TB.onmousedown = function(){
var vo_tr = window.event.srcElement;
if(vo_tr.tagName == "TABLE")
return;
while(vo_tr.tagName != "TR"){
vo_tr = vo_tr.parentElement;
if(vo_tr.tagName == "TABLE")
return;
} if(mylist_Config.CurTr != null)
mylist_Config.CurTr.className = "menu_UnSelect";
this.SelectedIndex = vo_tr.rowIndex;
this.SelectItem();
}
}
红色标准部分是调用方法的部分,提示“对象不支持此属性或方法”
this.SelectItem = function(){
if (this.SelectedIndex < 0)
return;
var vo_tr = this.TB.rows[this.SelectedIndex];
if (vo_tr != null){
vo_tr.className = "menu_Select";
mylist_Config.CurItem = vo_tr.tag;
mylist_Config.CurTr = vo_tr;
}
}
改成 function SelectItem(){
....
}
试试