mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
chartingfrontend: fixing sorting bug
git-svn-id: https://svn.fhem.de/fhem/trunk@4633 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2b6b781e5a
commit
4b964f3f97
@ -280,7 +280,7 @@ UPD 2013-12-26_08:39:37 10257 www/frontend/app/view/TableDataGridPanel.js
|
||||
UPD 2014-01-03_01:24:06 65039 www/frontend/app/view/LineChartPanel.js
|
||||
UPD 2014-01-12_12:09:17 5144 www/frontend/app/view/StatusPanel.js
|
||||
UPD 2014-01-12_12:55:22 10486 www/frontend/app/view/Viewport.js
|
||||
UPD 2014-01-12_02:42:27 21844 www/frontend/app/controller/MainController.js
|
||||
UPD 2014-01-12_04:44:35 22438 www/frontend/app/controller/MainController.js
|
||||
UPD 2014-01-12_02:49:58 16562 www/frontend/app/controller/StatusController.js
|
||||
UPD 2014-01-12_03:28:35 109269 www/frontend/app/controller/ChartController.js
|
||||
UPD 2013-06-30_11:46:54 5415 www/frontend/app/controller/TableDataController.js
|
||||
|
@ -232,6 +232,18 @@ Ext.define('FHEM.controller.MainController', {
|
||||
}
|
||||
});
|
||||
|
||||
// sort root by treeindex as inserting with index whil some objects not added may be faulty
|
||||
rootNode.sort(function(rec, rec2) {
|
||||
if (rec && rec.raw && rec.raw.data && rec.raw.data.VALUE &&
|
||||
rec2 && rec2.raw && rec2.raw.data && rec2.raw.data.VALUE) {
|
||||
if (rec.raw.data.VALUE.treeIndex > rec2.raw.data.VALUE.treeIndex) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
|
||||
// at last we add a chart template to the folder which wont be saved to db and cannot be deleted
|
||||
chartchild = {text: 'Create new Chart', leaf: true, data: {template: true}, iconCls:'x-tree-icon-leaf-chart'};
|
||||
chartfoldernode.appendChild(chartchild);
|
||||
|
Loading…
Reference in New Issue
Block a user