PDA

View Full Version : red color at cell grid



deadflo
11 Aug 2012, 1:11 AM
hi all, i have problem when i want to update data from cell grid, sometimes the data can update and sometimes can work. if not work i have red color at cell grid just like my pic . why this can happend. anyone can explain about this?

37872

skirtle
11 Aug 2012, 8:59 AM
The red triangle denotes a dirty field value. There are a few ways to get rid of it:


Reject the changes to the model, reverting it back to its original value.
Commit the changes to the model, which is a bit like saving them but makes no attempt to contact the server.
Use CSS to remove the triangle.


For details on the CSS option see:

http://skirtlesden.com/articles/styling-extjs-grid-cells

mankz
12 Aug 2012, 7:01 AM
Or

4. http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.Table-cfg-markDirty

skirtle
13 Aug 2012, 8:21 AM
Yeah, 4 is probably the easiest way to do it, much better than 3. Deciding between 1, 2 and 4 depends on what state you want your records to be in.

deadflo
14 Aug 2012, 5:46 AM
Now, my code is working. iam just edit code just like this
my code before
bbar: [{}],
listeners:{
afteredit: function(grid){
if(grid.record.data.urutan2=="U"){
my = grid.record.data.urutan+1;
} else if(grid.record.data.urutan2=="D"){
my = grid.record.data.urutan-1;
}
............
}
}

after edit

bbar: [{}],
listeners:{
afteredit: function(grid){
if(grid.record.data.urutan2=="U"){
my = grid.record.data.urutan+1;
} else if(grid.record.data.urutan2=="D"){
my = grid.record.data.urutan-1;
} else {
my = grid.record.data.urutan;
}

............
}
}

iam just add

} else {
my = grid.record.data.urutan;
}

whether this effect and lead to mark dirty ?