Skip to content

Instantly share code, notes, and snippets.

@garyjoy
Created July 7, 2014 06:32
Show Gist options
  • Save garyjoy/77f2564fce487e472f3e to your computer and use it in GitHub Desktop.
Save garyjoy/77f2564fce487e472f3e to your computer and use it in GitHub Desktop.
Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5)
function createLazyGrid(containerId, tableStructure, dojoDataStore, queryFilter) {
var gridParameters = {
structure: tableStructure,
selectable: true,
store: dojoDataStore,
escapeHTMLInData: false,
autoRender: true,
autoWidth: true,
autoHeight: true,
rowsPerPage: 20,
query: queryFilter,
plugins:{
indirectSelection: true,
pagination:{pageSizes:false, description:true, pageStepper:true, gotoButton:true, maxPageStep:4, position:"bottom", defaultPage:20}
}
};
var lazyGrid = new dojox.grid.EnhancedGrid(gridParameters);
lazyGrid.placeAt(containerId);
lazyGrid.startup();
return lazyGrid;
}
function drawMyTable() {
dojo.empty("myTableDiv");
var tableStructure = [[
{field: "column1", name: "Column 1",width:"100px"},
{field: "column2" , name: "Column 2",width:"100px"},
{field: "column3", name: "Column 3",width:"100px"}
]];
var dojoDataStore = new bt.LazyLoadStore({lazyLoadFunction: lazyLoadMyData});
paUnAllocatedGrid = createLazyGrid('myTableDiv', tableStructure, dojoDataStore, {column1:'*'});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment