aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-03-13 09:31:41 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-03-13 09:31:41 +1300
commit5502e0657caa5d941de8139e834c8d8c089fa389 (patch)
tree2d541ddcbe1e8db42d7425bc0b0af2ed4fe5282a /web/app
parentf96a9f1b6f53ad8a25167360ca4545a83c24cac7 (diff)
downloadtrackermap-server-5502e0657caa5d941de8139e834c8d8c089fa389.tar.gz
trackermap-server-5502e0657caa5d941de8139e834c8d8c089fa389.tar.bz2
trackermap-server-5502e0657caa5d941de8139e834c8d8c089fa389.zip
Add search bar to devices list
Diffstat (limited to 'web/app')
-rw-r--r--web/app/view/Devices.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index ebe3ca195..2e9509609 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -62,6 +62,31 @@ Ext.define('Traccar.view.Devices', {
}]
},
+ bbar: [{
+ xtype: 'tbtext',
+ html: Strings.sharedSearch
+ }, {
+ xtype: 'textfield',
+ listeners: {
+ change: function () {
+ var tree, expr;
+ tree = this.up('treepanel');
+ expr = new RegExp(this.getValue(), 'i');
+ tree.store.filter({
+ id: 'nameFilter',
+ filterFn: function (node) {
+ var children, len, visible, i;
+ children = node.childNodes;
+ len = children && children.length;
+ visible = node.isLeaf() ? expr.test(node.get('name')) : false;
+ for (i = 0; i < len && !(visible = children[i].get('visible')); i++);
+ return visible;
+ }
+ });
+ }
+ }
+ }],
+
listeners: {
selectionchange: 'onSelectionChange',
beforeselect: 'onBeforeSelect'