grid.setCellTemplate(AW.Templates.Checkbox, 0);
grid.setColumnResizable(false, 0);
grid.setHeaderTemplate(new AW.Templates.Checkbox, 0);
grid.setHeaderValue(true, 0);
//configure the cell template
grid.onCellNormalTemplateChanged = configureCellTemplate;
grid.onCellCheckboxTemplateChanged = configureCellTemplate;
grid.onCellLinkTemplateChanged = configureCellTemplate;
grid.onCellTemplateChanged = function(){return true};
//define the different cell templates
grid.defineTemplate("cellNormal", new AW.Templates.Text);
grid.defineTemplate("cellImage", new AW.Templates.Image);
grid.defineTemplate("cellCheckbox", new AW.Templates.Checkbox);
grid.defineTemplate("cellLink", new AW.Templates.Link);
function configureCellTemplate (cell) {
cell.setAttribute("aw", "cell");
cell.setAttribute("title", "");
cell.setClass("grid", "cell");
cell.setClass("column", function(){return this.$0});
cell.setClass("cells", function(){return this.getControlProperty("state") || "normal"});
cell.mapModel("control", "cell");
cell.getStateProperty = function(p){return this.$owner.getRowProperty(p, this.$1)};
cell.setStateProperty = function(p, v){this.$owner.setRowProperty(p, v, this.$1)};
}
This topic is archived.