From 344799f3be95dded17bf068c42c0e8776e82aa3f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 4 Nov 2015 18:47:52 +1300 Subject: Find exact record matches in store --- web/app/view/StateController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/app/view/StateController.js') diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js index 29f6a7c6d..819c203c4 100644 --- a/web/app/view/StateController.js +++ b/web/app/view/StateController.js @@ -116,9 +116,9 @@ Ext.define('Traccar.view.StateController', { selectDevice: function (device) { var found; this.deviceId = device.get('id'); - found = Ext.getStore('LatestPositions').query('deviceId', this.deviceId); - if (found.getCount() > 0) { - this.updatePosition(found.first()); + found = Ext.getStore('LatestPositions').findRecord('deviceId', this.deviceId, 0, false, false, true); + if (found) { + this.updatePosition(found); } else { Ext.getStore('Attributes').removeAll(); } -- cgit v1.2.3