dojox.grid.EnhancedGrid 和 dojox.grid.DataGrid 的继承关系

 dojox.grid.EnhancedGrid  的介绍说, EnhancedGrid 是基于 DataGrid 提供增强功能的。

EnhancedGrid (dojox.grid.EnhancedGrid) provides a rich set of features that enhance the capabilities of base DataGrid. All these features are implemented as separate plugins which can be loaded on demand, the required features must be declared before used.

不引入插件的 EnhancedGrid 就像 DataGrid 一样。

所有,可以理解为 EnhancedGrid 是继承 DataGrid 的。或者说, EnhancedGrid 的原型是 DataGrid。

 

下面用代码证明 : 

    var grid = new dojox.grid.EnhancedGrid({
        id: 'grid',
        store: store,
        structure: layout,
        rowSelector: '20px'},
      document.createElement('div'));

    console.log(dojox.grid.EnhancedGrid.prototype.isPrototypeOf(grid));
    console.log(dojox.grid.DataGrid.prototype.isPrototypeOf(grid));

返回结果为 :

true 

true

EnhancedGrid 和 DataGrid 都是 EnhancedGrid Object 的原型。

 

    grid = new DataGrid({
        id: 'grid',
        store: store,
        structure: layout,
        rowSelector: '20px'});

    console.log(dojox.grid.EnhancedGrid.prototype.isPrototypeOf(grid));
    console.log(dojox.grid.DataGrid.prototype.isPrototypeOf(grid));

返回结果为 : 

false

true

EnhancedGrid 不是 DataGrid Object 的原型,只有 DataGrid 是 DataGrid Object 的原型。

 

所有,可以理解为 EnhancedGrid 是继承于 DataGrid

 

参考 : 

Object.prototype.isPrototypeOf(), mozilla

How to get a JavaScript object's class?, stackoverflow 

 

转载于:https://www.cnblogs.com/TonyYPZhang/p/5161942.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值