isDebug = true; useSignalR = true; dataUrl = baseUrl + '/App/GetProducts'; data = function data() { return { f7params: f7params, server: localStorage.getItem('server'), token: localStorage.getItem('token'), model: { products: [], scenes: [] } }; } methods = { GetProducts() { return Enumerable.from(this.model.products).orderBy('o=>o.DisplayOrder').toArray(); }, GetScenes() { return Enumerable.from(this.model.scenes).orderBy('o=>o.DisplayOrder').toArray(); }, CallScene(id) { ajax('/App/ExecGlobalScene', { token: token, connectionId: connectionId, id: id }, 'post'); } }; function onMessage(method, json, to, from) { debug(method + ':' + json); var item = JSON.parse(json); console.log(method + ':' + json); var item = JSON.parse(json); if (method == 'ProductEntityInserted' || method == 'ProductEntityUpdated' || method == 'ProductEntityDeleted' || method == 'DeviceEntityInserted' || //method == 'DeviceEntityUpdated' || method == 'DeviceEntityDeleted') { loadData(); } else if (method == 'SceneEntityInserted' || method == 'SceneEntityUpdated' || method == 'SceneEntityDeleted') { if (item.NodeId == null) { loadData(); } } } start();