父脚本
function w_menu()
{
 var gpo_object = dw_1; DW_1是我的控件 
 this.insert = funtion()
 {
  gpo_object.insertrow(0);
 }
}子脚本:
w_class.prototype = new w_menu();问题:
1.目前w_class已经有了w_menu的insert函数,我在自脚本如何扩展一些脚本?
重写我是会了直接
w_class.prototype.insert = funtion(){
alert("0");
}
这样只会执行弹出0,但是如何执行鼻祖脚本然后再弹出0,不会了~~
2.在父类定义的变量gpo_object在子类也访问不到了,如何访问

解决方案 »

  1.   

    gpo_object是在闭包中用var定义的,是私有属性,在子类是访问不到的
    不要写成私有的就行了
    this.gpo_object = dw_1; 
      

  2.   

    w_class.prototype._insert = w_class.prototype.insert;
    w_class.prototype.insert = funtion(){
    this._insert();
    alert("0");
    }
      

  3.   

      w_menu.prototype = new w_parent();
      w_menu.prototype.ExDataWindow_Insert = w_menu.prototype.DataWindow_Insert;
      w_menu.prototype.DataWindow_Insert = function () {
          this.ExDataWindow_Insert(); //为什么到这一句提示:对象不支持此属性或方法
          alert("0");
      }
      

  4.   

      w_menu.prototype = new w_parent();
      w_menu.prototype.ExDataWindow_Insert = w_menu.prototype.DataWindow_Insert;
      w_menu.prototype.DataWindow_Insert = function () {
          w_menu.prototype.ExDataWindow_Insert();
          alert("0");
      }
    我去。。这样是正常的