0

嗨,我正在使用 Dhtmlx Grid..我需要 dhtmlx tabbar..从他们的网站(http://www.dhtmlx.com/docs/products/dhtmlxTabbar/samples/05_components/01_grid_inside.html )参考,我开始知道首先初始化网格..我这样做了..但是选项卡部分没有工作..让我知道我在哪里更正代码..这是我的代码

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>


<!-- dhtmlxGrid -->

<link rel="stylesheet" type="text/css" href="../dhtmlxGrid/codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<link rel="STYLESHEET" type="text/css" href="../codebase/css/dhtmlxtabbar.css">
<script  src="../codebase/dhtmlxcommon.js"></script>
<script src="../codebase/dhtmlxgrid.js"></script>
<script  src="../codebase/ext/dhtmlxgrid_srnd.js"></script>
<script src="../codebase/dhtmlxgridcell.js"></script>
<script src="../codebase/dhtmlxcontainer.js"></script>
<script  src="../codebase/dhtmlxtabbar.js"></script>


<script type="text/javascript">

</script>
</head>
<body>


<div id="gridbox" style="width:600px;height:200px">
<div id="a_tabbar" style="width:395px; height:390px;"></div>
</div>
<script>//Loading data from XML:

 mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("../codebase/imgs/");
    mygrid.setHeader("Name,Index,Code");
    mygrid.setInitWidths("150,150,*");
    mygrid.setColAlign("left,left");
    mygrid.setColSorting("str,str,str");
    mygrid.setColTypes("txt,txt,txt");
    mygrid.setSkin("dhx_skyblue");
    mygrid.loadXML("../grid.xml");//load data */ 
    mygrid.init();
  tabbar = new dhtmlXTabBar("a_tabbar", "top");
    tabbar.setSkin('dhx_skyblue');
    tabbar.setImagePath("codebase/imgs/");
    tabbar.addTab("a1", "Tab 1-1", "100px");
    tabbar.addTab("a2", "Tab 1-2", "100px");
    tabbar.setTabActive("a1");
    mygrid = tabbar.cells("a1").attachGrid();
    mygrid.setImagePath("../../../dhtmlxGrid/codebase/imgs/"); 
    mygrid.attachEvent("onRowSelect", function(rowId,cIndex){alert(rowId)});
    </script>
</body>
</html>
4

1 回答 1

0

执行下一个方法:

tabbar = new dhtmlXTabBar("a_tabbar", "top");
tabbar.setSkin('dhx_skyblue');
tabbar.setImagePath("codebase/imgs/");
tabbar.addTab("a1", "Tab 1-1", "100px");
tabbar.addTab("a2", "Tab 1-2", "100px");
tabbar.setTabActive("a1");  

mygrid = tabbar.cells("a1").attachGrid();
mygrid.setImagePath("../codebase/imgs/");
mygrid.setHeader("Name,Index,Code");
mygrid.setInitWidths("150,150,*");
mygrid.setColAlign("left,left");
mygrid.setColSorting("str,str,str");
mygrid.setColTypes("txt,txt,txt");
mygrid.setSkin("dhx_skyblue");
mygrid.attachEvent("onRowSelect", function(rowId,cIndex){alert(rowId)});
mygrid.loadXML("../grid.xml");//load data */ 
mygrid.init();
于 2013-08-15T09:36:30.223 回答