{"id":9176,"date":"2017-11-23T16:54:41","date_gmt":"2017-11-23T15:54:41","guid":{"rendered":"http:\/\/www.wjst.de\/blog\/?p=9176"},"modified":"2017-12-18T12:55:09","modified_gmt":"2017-12-18T11:55:09","slug":"keep-your-excelsheet-updated-or-binding-to-websocket","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2017\/11\/keep-your-excelsheet-updated-or-binding-to-websocket\/","title":{"rendered":"Keep your Excelsheet updated ;-) or how to bind Kendo UI for jquery on a Synology to websocket"},"content":{"rendered":"<p>This is not really about Excel but about Kendo Grid&#8217;s ability to update grid data in the browser. \u00a0This is already my second attempt as a Mosquitto based MQTT solution did not work properly.<\/p>\n<figure id=\"attachment_9177\" aria-describedby=\"caption-attachment-9177\" style=\"width: 620px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2017\/11\/screen-2.jpg\" data-rel=\"key-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9177 size-medium\" src=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2017\/11\/screen-2-620x499.jpg\" alt=\"\" width=\"620\" height=\"499\" srcset=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2017\/11\/screen-2-620x499.jpg 620w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2017\/11\/screen-2-768x618.jpg 768w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2017\/11\/screen-2-621x500.jpg 621w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2017\/11\/screen-2.jpg 837w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><figcaption id=\"caption-attachment-9177\" class=\"wp-caption-text\">Demo Grid<\/figcaption><\/figure>\n<p>Installing node.js on the Synology is straightforward &#8211; just use the package manager. We also need some local packages. Change into the target directory and type<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nnpm install express\r\nnpm install typescript\r\nnpm install ws\r\n<\/pre>\n<p>Copy also app.js from <a href=\"https:\/\/github.com\/telerik\/kendoui-ws-demo\">https:\/\/github.com\/telerik\/kendoui-ws-demo<\/a> into that directory. Unfortunately app.js breaks in line 5 (we need another port as 5000 is already occupied in the Synology). It also crashes in line 6, as the node.js V4 version needs full extension. So use the following lines<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nvar WebSocketServer = require(&quot;ws&quot;).Server;\r\nvar http = require(&quot;http&quot;);\r\nvar express = require(&quot;express&quot;);\r\nvar app = express();\r\nvar port = process.env.PORT || 5050;\r\nvar products = require(&quot;.\/products.js&quot;);\r\n<\/pre>\n<p>Then start the server by<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/usr\/local\/bin\/node \/volume1\/web\/kendoui-ws-demo-master\/app.js &amp;\r\n<\/pre>\n<p>Get the client script in kendoui.for.jquery.2017.3.1018.trial\/examples\/grid\/web-socket.html and change the host. Take care to use ws (Websocket), not wss (Websocket secure) <a href=\"https:\/\/stackoverflow.com\/questions\/2844257\/node-js-and-wss\">unless you know what you are doing<\/a>.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/\/var host = &quot;wss:\/\/kendoui-ws-demo.herokuapp.com&quot;;\r\nvar host = &quot;ws:\/\/myserver:5050&quot;;\r\n<\/pre>\n<p>That&#8217;s it.<\/p>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 15.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>This is not really about Excel but about Kendo Grid&#8217;s ability to update grid data in the browser. \u00a0This is already my second attempt as a Mosquitto based MQTT solution did not work properly. Installing node.js on the Synology is straightforward &#8211; just use the package manager. We also need some local packages. Change into &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2017\/11\/keep-your-excelsheet-updated-or-binding-to-websocket\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Keep your Excelsheet updated ;-) or how to bind Kendo UI for jquery on a Synology to websocket<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-9176","post","type-post","status-publish","format-standard","hentry","category-computer-software"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/9176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=9176"}],"version-history":[{"count":7,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/9176\/revisions"}],"predecessor-version":[{"id":9239,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/9176\/revisions\/9239"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=9176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=9176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=9176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}