[dss-commits] r8881 - in dss/trunk: data/webroot/js websrc/dss-setup-interface/dSS websrc/dss-setup-interface/dSS/data websrc/dss-setup-interface/dSS/grid
dss-commits at forum.digitalstrom.org
dss-commits at forum.digitalstrom.org
Wed Nov 4 11:43:13 CET 2009
Author: mfernandez
Date: 2009-11-04 11:43:13 +0100 (Wed, 04 Nov 2009)
New Revision: 8881
Modified:
dss/trunk/data/webroot/js/dss-setup-interface.js
dss/trunk/websrc/dss-setup-interface/dSS/ZoneBrowser.js
dss/trunk/websrc/dss-setup-interface/dSS/data/DeviceStore.js
dss/trunk/websrc/dss-setup-interface/dSS/grid/DevicePanel.js
Log:
Added new columns to device browser
- Added columns "first seen" and "last discovered" to device grid
- Set initial sort order to DESC in column "first seen"
Modified: dss/trunk/data/webroot/js/dss-setup-interface.js
===================================================================
--- dss/trunk/data/webroot/js/dss-setup-interface.js 2009-11-02 11:00:06 UTC (rev 8880)
+++ dss/trunk/data/webroot/js/dss-setup-interface.js 2009-11-04 10:43:13 UTC (rev 8881)
@@ -278,7 +278,9 @@
{name:"on"},
{name:"circuit"},
{name:"modulator"},
- {name:"zone"}
+ {name:"zone"},
+ {name:"firstSeen"},
+ {name:"lastDiscovered"}
]);
var deviceReader = new Ext.data.JsonReader(
@@ -288,7 +290,10 @@
deviceRecord
);
- Ext.apply(this, { reader: deviceReader });
+ Ext.apply(this, { reader: deviceReader, sortInfo: {
+ field: 'firstSeen',
+ direction: 'DESC' // or 'DESC' (case sensitive for local sorting)
+}});
dSS.data.DeviceStore.superclass.constructor.call(this, arguments);
}
});
@@ -299,12 +304,14 @@
initComponent: function() {
var deviceCols = [
- {id: 'id', header: "id", width: 50, sortable: true, dataIndex: 'id'},
- {id: 'name', header: "name", width: 50, sortable: true, dataIndex: 'name', editable: true, editor: new Ext.form.TextField()},
+ {id: 'id', header: "id", width: 150, sortable: true, dataIndex: 'id'},
+ {id: 'name', header: "name", width: 150, sortable: true, dataIndex: 'name', editable: true, editor: new Ext.form.TextField()},
{header: "on", width: 50, sortable: true, dataIndex: 'on'},
- {header: "circuit", width: 50, sortable: true, dataIndex: 'circuit'},
- {header: "modulator", width: 50, sortable: true, dataIndex: 'modulator'},
+ {header: "circuit", width: 100, sortable: true, dataIndex: 'circuit'},
+ {header: "modulator", width: 150, sortable: true, dataIndex: 'modulator'},
{header: "zone", width: 50, sortable: true, dataIndex: 'zone'},
+ {header: "first seen", width: 150, sortable: true, dataIndex: 'firstSeen', xtype: 'datecolumn', format: 'c'},
+ {header: "last discovered", width: 150, sortable: true, dataIndex: 'lastDiscovered', xtype: 'datecolumn', format: 'c'}
];
var editor = new Ext.ux.grid.RowEditor({
@@ -324,9 +331,12 @@
ddGroup : "zoneDeviceDD",
enableDragDrop : true,
stripeRows : true,
- autoExpandColumn : 'id',
+ forceFit : true,
title : 'Devices',
- plugins : [editor]
+ plugins : [editor],
+ viewConfig: {
+ autoFill: true
+ }
});
dSS.grid.DevicePanel.superclass.initComponent.apply(this, arguments);
@@ -383,7 +393,7 @@
}
this.devicePanel.getStore().filterBy(function(record) {
for(var i = 0; i < selectedZones.length; i++) {
- if(record.data.zone == selectedZones[i].data.id) {
+ if(record.get('zone') === selectedZones[i].get('id')) {
return true;
}
}
@@ -395,6 +405,8 @@
Ext.each(structure.apartment.zones, function(zone) {
if(zone.id === 0) { // Skip zone 0
Ext.each(zone.devices, function(device) {
+ device.firstSeen = Date.parseDate(device.firstSeen, "U");
+ device.lastDiscovered = Date.parseDate(device.lastDiscovered, "U");
devices.push(device);
});
}
Modified: dss/trunk/websrc/dss-setup-interface/dSS/ZoneBrowser.js
===================================================================
--- dss/trunk/websrc/dss-setup-interface/dSS/ZoneBrowser.js 2009-11-02 11:00:06 UTC (rev 8880)
+++ dss/trunk/websrc/dss-setup-interface/dSS/ZoneBrowser.js 2009-11-04 10:43:13 UTC (rev 8881)
@@ -42,7 +42,7 @@
}
this.devicePanel.getStore().filterBy(function(record) {
for(var i = 0; i < selectedZones.length; i++) {
- if(record.data.zone == selectedZones[i].data.id) {
+ if(record.get('zone') === selectedZones[i].get('id')) {
return true;
}
}
@@ -54,6 +54,8 @@
Ext.each(structure.apartment.zones, function(zone) {
if(zone.id === 0) { // Skip zone 0
Ext.each(zone.devices, function(device) {
+ device.firstSeen = Date.parseDate(device.firstSeen, "U");
+ device.lastDiscovered = Date.parseDate(device.lastDiscovered, "U");
devices.push(device);
});
}
Modified: dss/trunk/websrc/dss-setup-interface/dSS/data/DeviceStore.js
===================================================================
--- dss/trunk/websrc/dss-setup-interface/dSS/data/DeviceStore.js 2009-11-02 11:00:06 UTC (rev 8880)
+++ dss/trunk/websrc/dss-setup-interface/dSS/data/DeviceStore.js 2009-11-04 10:43:13 UTC (rev 8881)
@@ -9,7 +9,9 @@
{name:"on"},
{name:"circuit"},
{name:"modulator"},
- {name:"zone"}
+ {name:"zone"},
+ {name:"firstSeen"},
+ {name:"lastDiscovered"}
]);
// a json reader to read the device data
@@ -20,7 +22,10 @@
deviceRecord
);
- Ext.apply(this, { reader: deviceReader });
+ Ext.apply(this, { reader: deviceReader, sortInfo: {
+ field: 'firstSeen',
+ direction: 'DESC' // or 'DESC' (case sensitive for local sorting)
+}});
dSS.data.DeviceStore.superclass.constructor.call(this, arguments);
}
});
Modified: dss/trunk/websrc/dss-setup-interface/dSS/grid/DevicePanel.js
===================================================================
--- dss/trunk/websrc/dss-setup-interface/dSS/grid/DevicePanel.js 2009-11-02 11:00:06 UTC (rev 8880)
+++ dss/trunk/websrc/dss-setup-interface/dSS/grid/DevicePanel.js 2009-11-04 10:43:13 UTC (rev 8881)
@@ -6,12 +6,14 @@
initComponent: function() {
var deviceCols = [
- {id: 'id', header: "id", width: 50, sortable: true, dataIndex: 'id'},
- {id: 'name', header: "name", width: 50, sortable: true, dataIndex: 'name', editable: true, editor: new Ext.form.TextField()},
+ {id: 'id', header: "id", width: 150, sortable: true, dataIndex: 'id'},
+ {id: 'name', header: "name", width: 150, sortable: true, dataIndex: 'name', editable: true, editor: new Ext.form.TextField()},
{header: "on", width: 50, sortable: true, dataIndex: 'on'},
- {header: "circuit", width: 50, sortable: true, dataIndex: 'circuit'},
- {header: "modulator", width: 50, sortable: true, dataIndex: 'modulator'},
+ {header: "circuit", width: 100, sortable: true, dataIndex: 'circuit'},
+ {header: "modulator", width: 150, sortable: true, dataIndex: 'modulator'},
{header: "zone", width: 50, sortable: true, dataIndex: 'zone'},
+ {header: "first seen", width: 150, sortable: true, dataIndex: 'firstSeen', xtype: 'datecolumn', format: 'c'},
+ {header: "last discovered", width: 150, sortable: true, dataIndex: 'lastDiscovered', xtype: 'datecolumn', format: 'c'}
];
var editor = new Ext.ux.grid.RowEditor({
@@ -32,9 +34,13 @@
ddGroup : "zoneDeviceDD",
enableDragDrop : true,
stripeRows : true,
- autoExpandColumn : 'id',
+ forceFit : true,
+// autoExpandColumn : 'name',
title : 'Devices',
- plugins : [editor]
+ plugins : [editor],
+ viewConfig: {
+ autoFill: true
+ }
});
dSS.grid.DevicePanel.superclass.initComponent.apply(this, arguments);
More information about the dss-commits
mailing list