Commit 5f5b408b authored by Dietmar Maurer's avatar Dietmar Maurer

copy grid/CheckColumn.js from manager to manager5

parent e97c2f7e
// partly copied from extjs/examples/ux/CheckColumn.js
Ext.define('PVE.CheckColumn', {
extend: 'Ext.grid.column.Column',
alias: 'widget.checkcolumn',
constructor: function(cfg) {
this.renderer = function(value){
var cssPrefix = Ext.baseCSSPrefix,
cls = [cssPrefix + 'grid-checkheader'];
if (value) {
cls.push(cssPrefix + 'grid-checkheader-checked');
}
return '<div class="' + cls.join(' ') + '">&#160;</div>';
};
this.addEvents('checkchange');
this.callParent(arguments);
},
processEvent: function(type, view, cell, recordIndex, cellIndex, e) {
if (type == 'mousedown') {
var record = view.panel.store.getAt(recordIndex),
dataIndex = this.dataIndex,
checked = !record.get(dataIndex);
record.set(dataIndex, checked);
this.fireEvent('checkchange', this, record, checked);
return false;
} else {
return this.callParent(arguments);
}
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment