JSFiddle - React, Tailwind, and code Playground
by Mani T
HTML
<body class="tundra">
<div id="dynamicButton"></div>
<div id="gridDiv"></div>
</body>
CSS
@import url("http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dijit/themes/tundra/tundra.css");
@import url("http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojox/grid/enhanced/resources/tundraEnhancedGrid.css");
#gridDiv{
height:300px;
width: 80%;
}
JavaScript
require(
["dojo/_base/xhr",
"dojo/ready", "dojox/grid/EnhancedGrid",
"dojo/data/ItemFileWriteStore",
"dojox/grid/enhanced/plugins/Pagination"
],
function(xhr, ready, EnhancedGrid,
ItemFileWriteStore, Pagination) {
ready(function() {
detailRows = [];
var data = [{
"name": "ramu",
"sid": 101,
"marks": 80,
"remarks": {
"behaviour": "good",
"comments": "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
}
}, {
"name": "somu",
"sid": 102,
"marks": 85,
"remarks": {
"behaviour": "v.good",
"comments": "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
}
}, {
"name": "ravan",
"sid": 103,
"marks": 50,
"remarks": {
"behaviour": "bad",
"comments": "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
}
}];
function getBlank(inRowIndex) {
return "";
}
// html for the +/- cell
function fmtCheck(data, inRowIndex) {
var image = (detailRows[inRowIndex] ? 'http://4.bp.blogspot.com/-qYSNdCwKzU4/VFNV3twqmAI/AAAAAAAACCI/BIHhQvCllQE/s1600/open.gif' : 'http://4.bp.blogspot.com/-zFQPHA_Ecl8/VFNV3uJ4azI/AAAAAAAACCM/fRsK90ADI7s/s1600/closed.gif');
var show = (detailRows[inRowIndex] ? 'false' : 'true');
return '<img height="15" width="15" src="' + image + '" onclick="toggleDetail(' + inRowIndex + ', ' + show + ') ">';
}
function formatSubGrid(data) {
return "<div><div>" + data.behaviour + "</div>" + "<div>" + data.comments +...