Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS 4.x: How to disable "dirty record" red corner in Ext.grid.Panel cells?

Tags:

extjs4

I have an Ext.grid.Panel (aka gridpanel) with a store, used only for client-side visual effects (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?

Note: The solutions in this similar question either involve CSS or only work for ExtJS 3. I'm hoping to find a programmatic "setting" that works for ExtJS 4.

like image 602
Clint Harris Avatar asked Jan 02 '12 16:01

Clint Harris


2 Answers

Its working again in ExtJS 4.1.1. Use the markDirty configurationProperty in the gridview.

When you have a GridPanel, use it like this:

viewConfig:{     markDirty:false } 

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

like image 143
mesx Avatar answered Sep 29 '22 02:09

mesx


Based on the responses here and on the Sencha forums, and after looking at the ExtJS source, the answer is basically:

No, there isn't a simple way (at least in 4.0.7) to configure a grid to not show the red corners without using CSS.

Thanks for all the brainstorming and additional info from everyone. I'm throwing this up so anyone who comes across this in the future can see a clear "answer" to my question.

like image 43
Clint Harris Avatar answered Sep 29 '22 00:09

Clint Harris