我正在使用带有ItemFileWriteStore和过滤器插件的dojo增强型网格。
dojo.require("dojox.grid.EnhancedGrid");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.require("dijit.form.Select");
dojo.require("dojox.grid.enhanced.plugins.Filter");
dojo.require("dojox.grid.enhanced.plugins.exporter.CSVWriter");
dojo.ready(function(){
/*set up data store*/
var data = {
identifier: 'id',
items: []
};
var structure = [{
cells:[
{field: "id", datatype: "string", autoComplete: true },
{field: "pecla_ID", datatype: "string", autoComplete: true }
}];
var store = new dojo.data.ItemFileWriteStore({ url: "xGetAllClaims.xsp"});
/*set up layout*/
var layout = [[
{'name': 'Claim Running No.', 'field': 'pecla_ID', datatype: "string", autoComplete: true, 'width': '138px'},
{'name': 'Internal No.', 'field': 'pecla_InternalID', 'width': '138px', filterable: false}
]];
/*create a new grid:*/
var grid = new dojox.grid.EnhancedGrid({
id: 'grid',
store: store,
structure: layout,
rowSelector: '20px',
plugins: {
exporter: true,
filter: {
// Show the closeFilterbarButton at the filter bar
// Set the maximum rule count to 5
ruleCount: 5,
structure:structure,
// Set the name of the items
itemsName: "id"
}
}},
document.createElement('div')
);
/*append the new grid to the div*/
dojo.byId("gridDiv").appendChild(grid.domNode);
/*Call startup() to render the grid*/
grid.startup();
grid.on("RowDblClick", function(evt){
var idx = evt.rowIndex,
rowData = grid.getItem(idx);
// The rowData is returned in an object, last is the last name, first is the first name
window.open(rowData.notesurl,"_self")
}, true);
});
现在我的问题:我想将数据导出到Excel 我尝试使用导出插件将XAgent导出为CSV,然后导出到Excel 但是当CSV数据大到大(大约14000行)时,我从服务器(Domino 8.5.3 FP6)收到错误 (无效的发布请求异常)
听到我的代码:
dijit.byId("grid").exportGrid("csv",{
writerArgs: {
separator: ";"
}
}, function(str){
var form = document.createElement('form');
dojo.attr(form, 'method', 'POST');
document.body.appendChild(form);
dojo.io.iframe.send({
url: "xExportToExcel.xsp",
form: form,
method: "POST",
content: {exp: str},
timeout: 900000
});
document.body.removeChild(form);
}
);
有谁知道如何从过滤的行中获取标识符以减少数据量?