Currently, I am utilizing extjs 3.2 and recently experimented with a sample for coloring grid rows by referring to . I added a grid view configuration in the gridExample.js file which holds a static grid.
viewConfig: {
stripeRows: false,
getRowClass: function(record) {
return record.get('age') < 18 ? 'child-row' : 'adult-row';
}
I also included CSS in the HTML page.
The HTML code is as follows:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>success</title>
<link href="/testing/ext/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<link href="/testing/ext/resources/css/test.css" rel="stylesheet" type="text/css" />
<style>
.child-row .x-grid-cell {
background-color: #ffe2e2;
color: #900;
}
.adult-row .x-grid-cell {
background-color: #e2ffe2;
color: #090;
}
</style>
<script src="/testing/ext/adapter/ext/ext-base.js"></script>
<script src="/testing/ext/ext-all.js"></script>
<script src="/testing/JS/gridExample.js"></script>
</head>
<body>
</body>
</html>
Despite following advice from numerous forums, the grid row colors remain unchanged. Is there possibly an issue with the CSS on the HTML page? Thank you for any assistance provided in advance.