Commit 363d7139 authored by Dietmar Maurer's avatar Dietmar Maurer

add CheckColumn class

parent 424ee652
...@@ -15,6 +15,22 @@ ...@@ -15,6 +15,22 @@
background-image:url(../images/display.png); background-image:url(../images/display.png);
} }
.x-grid-checkheader {
height: 14px;
background-image: url(../images/unchecked.png);
background-position: 50% -2px;
background-repeat: no-repeat;
background-color: transparent;
}
.x-grid-checkheader-checked {
background-image: url(../images/checked.png);
}
.x-grid-checkheader-editor .x-form-cb-wrap {
text-align: center;
}
.x-selectable, .x-selectable * { .x-selectable, .x-selectable * {
-moz-user-select: text!important; -moz-user-select: text!important;
-khtml-user-select: text!important; -khtml-user-select: text!important;
......
...@@ -10,7 +10,12 @@ all: ...@@ -10,7 +10,12 @@ all:
# tigervnc.png converted from tigervnc sources # tigervnc.png converted from tigervnc sources
# (tigervnc.org/media/tigervnc_16.svg) # (tigervnc.org/media/tigervnc_16.svg)
# checked.png converted from extjs examples/ux/css/images/checked.gif
# unchecked.png converted from extjs examples/ux/css/images/unchecked.gif
GNOME_IMAGES = \ GNOME_IMAGES = \
checked.png \
unchecked.png \
start.png \ start.png \
stop.png \ stop.png \
gtk-stop.png \ gtk-stop.png \
......
...@@ -43,6 +43,8 @@ JSSRC= \ ...@@ -43,6 +43,8 @@ JSSRC= \
form/FileSelector.js \ form/FileSelector.js \
form/StorageSelector.js \ form/StorageSelector.js \
form/BridgeSelector.js \ form/BridgeSelector.js \
form/SecurityGroupSelector.js \
form/IPSetSelector.js \
form/CPUModelSelector.js \ form/CPUModelSelector.js \
form/VNCKeyboardSelector.js \ form/VNCKeyboardSelector.js \
form/LanguageSelector.js \ form/LanguageSelector.js \
...@@ -53,6 +55,7 @@ JSSRC= \ ...@@ -53,6 +55,7 @@ JSSRC= \
form/DayOfWeekSelector.js \ form/DayOfWeekSelector.js \
form/BackupModeSelector.js \ form/BackupModeSelector.js \
form/ScsiHwSelector.js \ form/ScsiHwSelector.js \
form/FirewallPolicySelector.js \
dc/Tasks.js \ dc/Tasks.js \
dc/Log.js \ dc/Log.js \
panel/StatusPanel.js \ panel/StatusPanel.js \
...@@ -66,14 +69,21 @@ JSSRC= \ ...@@ -66,14 +69,21 @@ JSSRC= \
window/Backup.js \ window/Backup.js \
window/Restore.js \ window/Restore.js \
panel/NotesView.js \ panel/NotesView.js \
grid/CheckColumn.js \
grid/SelectFeature.js \ grid/SelectFeature.js \
grid/ObjectGrid.js \ grid/ObjectGrid.js \
grid/ResourceGrid.js \ grid/ResourceGrid.js \
grid/PoolMembers.js \ grid/PoolMembers.js \
grid/FirewallRules.js \
grid/FirewallAliases.js \
grid/FirewallOptions.js \
tree/ResourceTree.js \ tree/ResourceTree.js \
panel/IPSet.js \
panel/ConfigPanel.js \ panel/ConfigPanel.js \
panel/SubConfigPanel.js \
grid/BackupView.js \ grid/BackupView.js \
panel/LogView.js \ panel/LogView.js \
panel/Firewall.js \
ceph/Pool.js \ ceph/Pool.js \
ceph/OSD.js \ ceph/OSD.js \
ceph/Disks.js \ ceph/Disks.js \
...@@ -161,6 +171,7 @@ JSSRC= \ ...@@ -161,6 +171,7 @@ JSSRC= \
dc/Backup.js \ dc/Backup.js \
dc/HAConfig.js \ dc/HAConfig.js \
dc/Support.js \ dc/Support.js \
dc/SecurityGroups.js \
dc/Config.js \ dc/Config.js \
Workspace.js Workspace.js
......
// 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