<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>On Demand Paging Method</title>
|
<meta name="viewport" content="width=570">
|
<style>
|
@import "../../dojo/resources/dojo.css";
|
@import "../css/dgrid.css";
|
@import "../css/skins/tundra.css";
|
.heading {
|
font-weight: bold;
|
margin-left: 12px;
|
padding-bottom: 0.25em;
|
}
|
.gridLabel {
|
font-weight: bold;
|
padding-bottom: 0.25em;
|
}
|
.dgrid {
|
margin: 10px;
|
}
|
/* this is not part of theme, but you can add odd-even coloring this way*/
|
.dgrid-row-odd {
|
background: #F2F5F9;
|
}
|
|
#grid {
|
width: 68em;
|
height: 50em;
|
padding: 1px;
|
}
|
</style>
|
<script src="../../dojo/dojo.js"
|
data-dojo-config="async: true"></script>
|
<script>
|
require(['dojo/_base/declare', 'dojo/_base/lang', 'dgrid/OnDemandGrid', 'dgrid/test/data/testPerformanceStore', 'dojo/domReady!'],
|
function(declare, lang, OnDemandGrid, testPerformanceStore){
|
var columns = [
|
{ name: 'Column 0', field: 'id', width: '10%' },
|
{ name: 'Column 1', field: 'integer', width: '10%' },
|
{ name: 'Column 2', field: 'floatNum', width: '10%' },
|
{ name: 'Column 3', field: 'date', width: '10%' },
|
{ name: 'Column 4', field: 'date2', width: '10%' },
|
{ name: 'Column 5', field: 'text', width: '10%' },
|
{ name: 'Column 6', field: 'bool', width: '10%' },
|
{ name: 'Column 7', field: 'bool2', width: '10%' },
|
{ name: 'Column 8', field: 'price', width: '10%' },
|
{ name: 'Column 9', field: 'today', width: '10%' }
|
];
|
new OnDemandGrid({
|
collection: testPerformanceStore,
|
columns: lang.mixin({}, columns),
|
pagingMethod: 'throttle'
|
}, 'gridThrottle');
|
new OnDemandGrid({
|
collection: testPerformanceStore,
|
columns: lang.mixin({}, columns),
|
pagingMethod: 'throttleDelayed'
|
}, 'gridThrottleDelayed');
|
new OnDemandGrid({
|
collection: testPerformanceStore,
|
columns: lang.mixin({}, columns),
|
pagingMethod: 'debounce'
|
}, 'gridDebounce');
|
});
|
|
</script>
|
</head>
|
<body class="tundra">
|
<h2 class="heading">Test the different OnDemandList pagingMethod choices.</h2>
|
<div class="gridLabel">throttle</div>
|
<div id="gridThrottle"></div>
|
<div class="gridLabel">throttleDelayed</div>
|
<div id="gridThrottleDelayed"></div>
|
<div class="gridLabel">debounce</div>
|
<div id="gridDebounce"></div>
|
</body>
|
</html>
|