I have tried a lot of variation but for some reason the selector checkbox doesnt show. Can anyone help me out with this please.
Below is the sample code I am using.
<!DOCTYPE html>
<html xmlns="http://ift.tt/lH0Osb">
<head>
<title></title>
<script type="text/javascript">
var djConfig = {
parseOnLoad: true
};
</script>
<script type="text/javascript" src="http://ift.tt/1Si4egM" ></script>
<script type="text/javascript">
require(["dojo/_base/declare", "dojo/_base/lang", "dojo/_base/array", "dojo/store/Memory", "dgrid/OnDemandGrid","dgrid/Selection", "dgrid/selector", "dstore/Trackable", "dojo/domReady!"],function (declare, lang, array, Memory, Grid, SelectionMixin, SelectorMixin, Trackable) {
var CustomGrid = declare([Grid, SelectionMixin, SelectorMixin]);
var data = [{
STRC_ID : "B988858",
Selected: false,
FNDG_CTGY_NB : "0010"
}, {
STRC_ID : "B9811118",
Selected: true,
FNDG_CTGY_NB : "0020"
}];
var TrackableMemory = declare([Memory, Trackable]);
var memory = new TrackableMemory({
idProperty: "STRC_ID",
data: data
});
var grid = new CustomGrid({
store: memory,
selectionMode: 'single',
columns: getSTColumns(),
allowSelectAll: true
}, 'gridHolder');
grid.startup();
function getSTColumns(){
return {
col1: { label: "", selector: 'checkbox' },
col2: { label: 'STRC_ID', field: "STRC_ID", sortable: false },
col3: { label: 'FNDG_CTGY_NB', field: 'FNDG_CTGY_NB' }
};
};
grid.refresh();
});
</script>
</head>
<body>
<div id="gridHolder"></div>
</body>
</html>
Thanks for the support inadvance.
Warm Regards
Aucun commentaire:
Enregistrer un commentaire