使用dojo中的dijit的组件中TabContainer制作可以关闭的tab

前端之家收集整理的这篇文章主要介绍了使用dojo中的dijit的组件中TabContainer制作可以关闭的tab前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使用dojo中的dijit的组件中TabContainer制作可以关闭的tab

以下为全部代码,设置能关闭tab方法

data-dojo-props="closable:true,onClose:function(){return 	confirm('really?');}"
<!DOCTYPE html>
<html>
<head>
    <Meta charset="utf-8">
    <title>Tutorial: Hello Dojo!</title>
    <style>
		@import "dojo/resources/dojo.css";
		@import "dijit/themes/tundra/tundra.css";
	</style>
    <script  type="text/javascript" src="dojo/dojo.js" data-dojo-config="isDebug: true,async: true,parSEOnLoad: true"></script>
   
</head>
<body class="tundra">
    
        <div data-dojo-type="dijit/layout/TabContainer" style="height:500px; width:400px;" doLayout="true"> 
            <div data-dojo-type="dijit/layout/ContentPane" title="tab1" data-dojo-props="closable:true,onClose:function(){return 	confirm('really?');}">
                date:<input  data-dojo-type="dijit/form/DateTextBox"/>
            </div>
             <div data-dojo-type="dijit/layout/ContentPane" title="tab2" data-dojo-props="closable:true,onClose:function(){return 	confirm('really?');}">
                abc
            </div>
             <div data-dojo-type="dijit/layout/ContentPane" title="tab3" data-dojo-props="closable:true,onClose:function(){return 	confirm('really?');}">
              	efg
            </div>
   	 </div>
    <script>
        // load requirements for declarative widgets in page content
        require(["dijit/form/DateTextBox","dijit/form/Button","dijit/layout/TabContainer","dijit/layout/ContentPane","dojo/parser","dojo/domReady!"]);
    </script>
</body>
此dojo版本为1.8

猜你在找的Dojo相关文章