Hi, i will move this topic from groups in google forum to here
my problem:
im sending data from mysql to template node displaying in a table.
im using the code of Steve Rickus, great code by the way
some changes includes editable and save button.
the original save by click i have changed to save by doubleclick, and i added a save button at end of each row
problem:
the original code does not catch the change, but forwards the original msg.payload
[{"id":"d239ca2f.6cf758","type":"inject","z":"48f8ead.7e90014","name":"Go","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":153.01734924316406,"y":511.0104064941406,"wires":[["e3a477cc.711798"]]},{"id":"e3a477cc.711798","type":"function","z":"48f8ead.7e90014","name":"dummyarray","func":"var myArray = [{ \"value1\": \"aaa\", \"value2\": \"A\", \"value3\": \"bbb\",\n\"value6\": \"B\", \"value4\": \"ccc\", \"value5\": \"C\", \"value7\": \"aaa\", \"value8\": \"A\",\n\"value9\": \"bbb\",\"value10\": \"B\", \"value11\": \"ccc\", \"value12\": \"C\"}];\nmsg.payload = myArray;\nreturn msg;","outputs":1,"noerr":0,"x":338.18404388427734,"y":541.0104103088379,"wires":[["328a7269.1b93de"]]},{"id":"328a7269.1b93de","type":"ui_template","z":"48f8ead.7e90014","group":"1bdd63f2.633acc","name":"Data-table","order":3,"width":"24","height":"14","format":"<style>\n th {\n text-decoration: underline;\n }\n .numeric {\n text-align: right;\n padding-right: 15px;\n }\n</style>\n\n<table cellpadding=\"1\" border=\"1\" id=\"table1\" class=\"table-hover\" style=\"width: 100%;\">\n <thead>\n <tr>\n <th>value1</th> \n <th>value2</th>\n <th>value3</th>\n <th>value4</th>\n <th>value5</th>\n <th>value7</th>\n <th>value8</th>\n <th>value9</th>\n <th>value10</th>\n <th>value11</th>\n <th>value12</th>\n <th>value13</th>\n <th>value14</th>\n <th>value15</th>\n <th>save</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat=\"row in msg.payload\" ng-dblclick=\"sendRow(row)\">\n <td class=\"numeric\" bgcolor=gray>{{row.value1}}</td>\n <td contenteditable=\"true\">{{row.value2}}</td>\n <td contenteditable=\"true\">{{row.value3}}</td>\n <td contenteditable=\"true\">{{row.value4}}</td>\n <td contenteditable=\"true\">{{row.value5}}</td>\n <td bgcolor=gray>{{row.value7}}</td>\n <td contenteditable=\"true\">{{row.value8}}</td>\n <td bgcolor=gray>{{row.value9}}</td>\n <td bgcolor=gray>{{row.value10}}</td>\n <td contenteditable=\"true\">{{row.value11}}</td>\n <td bgcolor=gray>{{row.value12}}</td>\n <td bgcolor=gray>{{row.value13}}</td>\n <td contenteditable=\"true\">{{row.value14}}</td>\n <td contenteditable=\"true\">{{row.value15}}</td>\n <td>\n\n <md-button ng-click=\"sendRow(row)\">Set</md-button>\n </tr>\n </tbody>\n</table>\n\n<script>\n(function($scope) {\n $scope.sendRow = function(obj) {\n $scope.send({ \"payload\": obj });\n $scope.send({ \"payload\": (document.getElementById(\"table1\").rows[1].innerHTML) });\n };\n})(scope);\n</script>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":565.0173492431641,"y":546.0104064941406,"wires":[["fc73bfc8.3103e"]]},{"id":"fc73bfc8.3103e","type":"debug","z":"48f8ead.7e90014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":804.0173492431641,"y":538.0104064941406,"wires":[]},{"id":"1bdd63f2.633acc","type":"ui_group","z":"","name":"Grafer","tab":"1cbf6c09.5ae5d4","order":1,"disp":true,"width":"32","collapse":false},{"id":"1cbf6c09.5ae5d4","type":"ui_tab","z":"","name":"Statistikk/Log","icon":"dashboard","order":1}]