PDA

View Full Version : How to disable “dirty record” red corner in Ext.grid.Panel cells?



charris
5 Jan 2012, 5:15 AM
I have an Ext.grid.Panel (aka gridpanel) with a store, used only for "visual effect" (i.e., nothing gets saved to the server). When I create new model instances and add them to the store they are shown in the grid with a red corner (presumably indicating that store changes haven't been saved).


At the moment I'm calling the .commit() method on each record/model before it is added to the store to prevent the dirty record red corner in the grid.


Is there a more generic way of simply configuring a grid panel to not display any visual indicators regarding the "dirty" status of a record?

I was hoping for a simple on/off setting but perhaps CSS is the only option?

Thanks!

drogers
5 Jan 2012, 5:52 AM
I don't know of a way to do it through configuration. Perhaps someone else does, it would be nice to have the option.

The following CSS has worked for me:


.x-grid-dirty-cell {
background-image: none;
}

fabio.parra
5 Jan 2012, 7:06 AM
In Ext 3 we had markDity option...
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.GridView-cfg-markDirty

twaindev
5 Jan 2012, 7:06 AM
3.x had a markDirty config, but 4.0.x has not. It will be reintroduced in 4.1. Until then you'll have to use the CSS solution.