加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

解决Dojo Grid 在TabContainer中的不显示或者刷新错误问题

发布时间:2020-12-16 21:53:55 所属栏目:百科 来源:网络整理
导读:修改TabContainer.js文件,在dijit.layout.TabController中添加函数onButtonClick,大功告成! 当然这个方法有点代价有点高,如果只是为了单独解决Grid问题,可以直接each一下Grid,修改一下就可以。 dojo.declare("dijit.layout.TabController",dijit.layou

修改TabContainer.js文件,在dijit.layout.TabController中添加函数onButtonClick,大功告成!

当然这个方法有点代价有点高,如果只是为了单独解决Grid问题,可以直接each一下Grid,修改一下就可以。

dojo.declare("dijit.layout.TabController",dijit.layout.StackController,{
        // summary:
        //      Set of tabs (the things with titles and a close button,that you click to show a tab panel).
        // description:
        //      Lets the user select the currently shown pane in a TabContainer or StackContainer.
        //      TabController also monitors the TabContainer,and whenever a pane is
        //      added or deleted updates itself accordingly.

        templateString: "
 
 
",// tabPosition: String // Defines where tabs go relative to the content. // "top","bottom","left-h","right-h" tabPosition: "top",// doLayout: Boolean // TODOC: deprecate doLayout? not sure. doLayout: true,// buttonWidget: String // The name of the tab widget to create to correspond to each page buttonWidget: "dijit.layout._TabButton",postMixInProperties: function(){ this["class"] = "dijitTabLabels-" + this.tabPosition + (this.doLayout ? "" : " dijitTabNoLayout"); this.inherited(arguments); }, onButtonClick: function(/*Widget*/ page){ // summary: // Called whenever one of my child buttons is pressed in an attempt to select a page this.inherited(arguments); dojo.forEach(page.getDescendants(),function(widget){ if(widget.resize)widget.resize(); }); }, //TODO: can this be accomplished in CSS? _rectifyRtlTabList: function(){ //Summary: Rectify the length of all tabs in rtl,otherwise the tab lengths are different in IE if(0 >= this.tabPosition.indexOf('-h')){ return; } if(!this.pane2button){ return; } var maxLen = 0; for(var pane in this.pane2button){ maxLen = Math.max(maxLen,dojo.marginBox(this.pane2button[pane].innerDiv).w); } //unify the length of all the tabs for(pane in this.pane2button){ this.pane2button[pane].innerDiv.style.width = maxLen + 'px'; } } });

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读