switch the gridpanel to a listview
This commit is contained in:
parent
28a313e74e
commit
5e1f6a8738
|
@ -44,9 +44,7 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
Deluge.ux.preferences.ExecutePage.superclass.initComponent.call(this);
|
Deluge.ux.preferences.ExecutePage.superclass.initComponent.call(this);
|
||||||
this.commands = this.add({
|
this.list = new Ext.list.ListView({
|
||||||
xtype: 'grid',
|
|
||||||
region: 'center',
|
|
||||||
store: new Ext.data.SimpleStore({
|
store: new Ext.data.SimpleStore({
|
||||||
fields: [
|
fields: [
|
||||||
{name: 'event', mapping: 1},
|
{name: 'event', mapping: 1},
|
||||||
|
@ -55,25 +53,25 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
id: 0
|
id: 0
|
||||||
}),
|
}),
|
||||||
columns: [{
|
columns: [{
|
||||||
width: 70,
|
width: .3,
|
||||||
header: _('Event'),
|
header: _('Event'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
renderer: fplain,
|
|
||||||
dataIndex: 'event'
|
dataIndex: 'event'
|
||||||
}, {
|
}, {
|
||||||
id: 'name',
|
id: 'name',
|
||||||
header: _('Command'),
|
header: _('Command'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
renderer: fplain,
|
|
||||||
dataIndex: 'name'
|
dataIndex: 'name'
|
||||||
}],
|
}],
|
||||||
stripRows: true,
|
singleSelect: true,
|
||||||
selModel: new Ext.grid.RowSelectionModel({
|
|
||||||
singleSelect: true
|
|
||||||
}),
|
|
||||||
autoExpandColumn: 'name'
|
autoExpandColumn: 'name'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.panel = this.add({
|
||||||
|
region: 'center',
|
||||||
|
items: [this.list]
|
||||||
|
});
|
||||||
|
|
||||||
this.details = this.add({
|
this.details = this.add({
|
||||||
xtype: 'tabpanel',
|
xtype: 'tabpanel',
|
||||||
region: 'south',
|
region: 'south',
|
||||||
|
@ -92,7 +90,7 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
Deluge.ux.preferences.ExecutePage.superclass.onShow.call(this);
|
Deluge.ux.preferences.ExecutePage.superclass.onShow.call(this);
|
||||||
deluge.client.execute.get_commands({
|
deluge.client.execute.get_commands({
|
||||||
success: function(commands) {
|
success: function(commands) {
|
||||||
this.commands.getStore().loadData(commands);
|
this.list.getStore().loadData(commands);
|
||||||
},
|
},
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue