如何在xpages中使用dojox datagrid?如果有人有代码片段,请发送给我thinkfatafat@gmail.com
我正在尝试使用以下代码,但在输出中什么都没有:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" dojoTheme="true"
dojoParseOnLoad="true" >
<link rel="stylesheet" type="text/css"
href="../dijit/themes/tundra/tundra.css" />
<link rel="stylesheet" type="text/css"
href="../dojox/grid/_grid/tundraGrid.css" />
<xp:this.resources>
<xp:dojoModule name="dojox.grid.DataGrid"></xp:dojoModule>
<xp:dojoModule name="dojox.grid"></xp:dojoModule>
</xp:this.resources>
<xp:panel >
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[makeGrid = function(){
dojo.require("dijit.form.Button");
dojo.require("dojox.grid.DataGrid");
var subrow1 = [{name: "Product Title"}, {name: "Price"}, {name: "Type"}];
var view = {rows: [ subrow1 ]};
var structure = [ view ];
var data = [
["Baseball gloves", 12.34, "Sports"],
["Tennis ball", 5.99, "Sports"],
["T-shirt", 12.45, "Clothing"],
["Hat", 12.45, "Clothing"]
];
var productModel = new dojox.grid.data.Table(null, data);
productModel.render();
};
XSP.addBeforeLoad(makeGrid);]]>
</xp:this.value>
</xp:scriptBlock>
<div dojoType="dojox.Grid" autoWidth="true" model="productModel"
structure="structure"></div>
</xp:panel>
</xp:view>
请帮助!!
答案 0 :(得分:2)
如果您正在运行Domino 8.5.2,那么您可以从OpenNTF下载Xpages扩展库,这里有使用内置的dojox网格的示例,无需编码:-): http://extlib.openntf.org/