}
];
- if (this.Modele.data.activeCUD) {
- this.checkColumn = new Ext.grid.CheckColumn({
- header:this.Modele.header.statut,
- dataIndex:this.Modele.dataIndex.statut,
- width:55
- });
- columns.push(this.checkColumn);
- } else {
- columns.push({
- header:this.Modele.header.statut,
- dataIndex:this.Modele.dataIndex.statut,
- width:150
- });
- }
-
+ var activeCUD = this.Modele.data.activeCUD;
+ var store = this.store;
+ this.checkColumn = new Ext.grid.CheckColumn({
+ header:this.Modele.header.statut,
+ dataIndex:this.Modele.dataIndex.statut,
+ width:55,
+ onMouseDown : function(e, t){
+ var index = this.grid.getView().findRowIndex(t);
+ var record = store.getAt(index);
+ if (activeCUD){
+ if (Ext.fly(t).hasClass(this.createId())) {
+ e.stopEvent();
+ record.set(this.dataIndex, !record.data[this.dataIndex]);
+ }
+ }
+ },
+ renderer : function(v, p, record) {
+ if (activeCUD){
+ p.css += ' x-grid3-check-col-td';
+ return String.format('<div class="x-grid3-check-col{0} {1}"> </div>', v ? '-on' : '', this.createId());
+ } else {
+ p.css += ' x-grid3-check-col-td';
+ return String.format('<div class="x-grid-checkheader-disabled x-grid3-check-col{0} {1}"> </div>', v ? '-on' : '', this.createId());
+ }
+ }
+ });
+ columns.push(this.checkColumn);
return columns;
},