javascript - EXTJS color a cell when Ext.property.Grid filled with content -
i have propertygrid in extjs. want color cell's text when fill content. init method:
initgrid : function(propertyvalues){ this.model = ext.decode(propertyvalues); this.flexcolumngrid.setsource({}); for(var in this.model){ //... var value = (this.model[i].value ? this.model[i].value : this.model[i].defval); this.flexcolumngrid.setproperty(this.model[i].key, value, true); }
defval default value property. use that, when value empty , there defval property. have value validate method, use that, when property change. it's afteredit event.
edit : function(ed,e) { //validate values }
i can color cell's text @ method
ext.get(e.row.getelementsbytagname('td')[e.colidx]).addcls('x-grid-wrong-value');
where:
.x-grid-wrong-value{color:red} //the css
but want validate values when grid filled content. how can this?
in general should use getrowclass
example how this:
how change background in row or cell
and example: fiddle changing background
Comments
Post a Comment