Hi, I am trying to work with this example flow except my data is stored in sqlite.
- my flow is here:
[{"id":"99f29eee.b00e48","type":"http in","z":"e54fc8b3.8e44a","name":"","url":"/mytable","method":"get","upload":false,"swaggerDoc":"","x":170,"y":200,"wires":[["5affd788.024e7"]]},{"id":"5affd788.024e7","type":"template","z":"e54fc8b3.8e44a","name":"web-template","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <!-- The jQuery library is a prerequisite for all jqSuite products -->\n <script type=\"text/ecmascript\" src=\"http://www.guriddo.net/demo/js/jquery.min.js\"></script> \n <!-- We support more than 40 localizations -->\n <script type=\"text/ecmascript\" src=\"http://www.guriddo.net/demo/js/trirand/i18n/grid.locale-en.js\"></script>\n <!-- This is the Javascript file of jqGrid --> \n <script type=\"text/ecmascript\" src=\"http://www.guriddo.net/demo/js/trirand/jquery.jqGrid.min.js\"></script>\n <!-- This is the localization file of the grid controlling messages, labels, etc.\n <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom -->\n <link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"http://struts.jgeppert.com/struts2-jquery-grid-showcase/themes/showcase/jquery-ui.css\" />\n <!-- The link to the CSS that the grid needs -->\n <link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"http://www.guriddo.net/demo/css/trirand/ui.jqgrid.css\" />\n <meta charset=\"utf-8\" />\n <title>Demo CRUD with jqGrid</title>\n <script type=\"text/javascript\"></script>\n </head>\n <body>\n <table id=\"jqGrid\"></table>\n <div id=\"jqGridPager\"></div>\n <script type=\"text/javascript\"> \n $(document).ready(function () {\n $(\"#jqGrid\").jqGrid({\n url: '/search',\n mtype: \"GET\",\n datatype: \"json\",\n colModel: [\n { label: 'ID', name: 'id', key: true, search: false, width: 75 },\n { label: 'Jmeno', name: 'jmeno', width: 150, editable: true, formoptions: { colpos: 1, rowpos: 1 } },\n { label: 'Příjmení', name: 'lastname', width: 150, editable: true, edittype: \"select\", formoptions: { colpos: 1, rowpos: 2 },\n editoptions: {\n dataUrl:'/search/lastname',\n type:\"GET\",\n buildSelect: function(data) {\n var response = jQuery.parseJSON(data); //JSON data\n var s = '<select>';\n if (response && response.length) {\n s += '<option hidden=\"true\">--- Select Lastname ---</option>';\n for (var i = 0, l=response.length; i<l ; i++) {\n var id = response[i].id;\n var val = response[i].value; \n // You can concatenate ID or any other string here\n //For example: var ri = response[i].id + response[i].value; \n s += '<option value=\"'+id+'\">'+val+'</option>';\n }\n }\n return s + \"</select>\";\n } \n } \n },\n { label: 'Adresa', name: 'adresa', width: 150, editable: true, formoptions: { colpos: 2, rowpos: 1 } },\n { label: 'Mail', name: 'mail', width: 150, editable: true, formoptions: { colpos: 2, rowpos: 1 } },\n { label: 'DIC', name: 'dic', width: 150, editable: true, formoptions: { colpos: 2, rowpos: 1 } },\n { label: 'Aktivní', name: 'aktivni', width: 150, align: \"center\", search: false, editable: true, edittype: \"checkbox\", formatter: \"checkbox\", editoptions: { value: \"1:0\" }, formoptions: { colpos: 2, rowpos: 2 } }\n ],\n width: 500,\n height: 260,\n rowNum: 10,\n loadonce: true,\n viewrecords: true,\n pager: \"#jqGridPager\"\n });\n \n $('#jqGrid').navGrid('#jqGridPager',\n // The buttons to appear on the toolbar of the grid\n { edit: true, add: true, del: true, search: true, refresh: true, view: true, position: \"left\", cloneToTop: true },\n \n // Options for the Edit Dialog\n {\n url: '/update',\n editCaption: \"The Edit Dialog\",\n recreateForm: true,\n\t\t\t\t\t //checkOnUpdate : true,\n\t\t\t\t\t //checkOnSubmit : true,\n\t\t\t\t\t beforeSubmit : function( postdata, form , oper) {\n\t\t\t\t\t\t if(confirm('Are you sure you want to update this information?') ) {\n\t\t\t\t\t\t\t // Do something\n\t\t\t\t\t\t \t return [true,'/update'];\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\treturn [false, 'Update failed!'];\n\t\t\t\t\t\t }\n\t\t\t\t\t },\n afterSubmit: function () {\n $(this).jqGrid(\"setGridParam\", {datatype: 'json'});\n return [true];\n },\n closeAfterEdit: true,\n errorTextFormat: function (data) {\n return 'Error: ' + data.responseText\n }\n },\n // Options for the Add Dialog\n {\n url: '/insert',\n addCaption: \"Add Dialog\",\n afterSubmit: function () {\n $(this).jqGrid(\"setGridParam\", {datatype: 'json'});\n return [true];\n },\n closeAfterAdd: true,\n recreateForm: true,\n errorTextFormat: function (data) {\n return 'Error: ' + data.responseText\n }\n },\n // Options for the Delete Dialog\n { \n url: '/delete',\n errorTextFormat: function (data) {\n return 'Error: ' + data.responseText\n }\n });\n $(\"#jqGrid\").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: true });\n });\n </script>\n </body>\n</html>","x":420,"y":200,"wires":[["f9c53b87.2a8a78"]]},{"id":"f9c53b87.2a8a78","type":"http response","z":"e54fc8b3.8e44a","name":"","statusCode":"","headers":{},"x":1140,"y":200,"wires":[]},{"id":"e7e5943a.cecc08","type":"http in","z":"e54fc8b3.8e44a","name":"","url":"/search","method":"get","upload":false,"swaggerDoc":"","x":170,"y":260,"wires":[["2d6a80d3.e2d02"]]},{"id":"2d6a80d3.e2d02","type":"function","z":"e54fc8b3.8e44a","name":"search-query","func":"//msg.topic=\"SELECT CONCAT('M00','',test.id) AS id,test.name AS name,lastname.lastname AS lastname,test.code AS code,test.married AS married FROM test INNER JOIN lastname ON lastname.id = test.lastname ORDER BY test.id DESC\";\nmsg.topic=\"select id, JMENO, PRIJMENI as LASTNAME, ADRESA, MAIL, DIC, AKTIVNI from OSOBY ORDER BY id DESC\";\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":260,"wires":[["40889cea.27b78c"]]},{"id":"2a801df6.e42a8a","type":"http response","z":"e54fc8b3.8e44a","name":"","statusCode":"","headers":{},"x":1330,"y":240,"wires":[]},{"id":"76cbf918.168de8","type":"function","z":"e54fc8b3.8e44a","name":"search-response","func":"return msg;","outputs":1,"noerr":0,"x":805,"y":260,"wires":[["3ed65af1.330266"]]},{"id":"3ed65af1.330266","type":"json","z":"e54fc8b3.8e44a","name":"","property":"payload","action":"","pretty":false,"x":990,"y":260,"wires":[["2a801df6.e42a8a","65ef894a.2ef98"]]},{"id":"3c05baff.0a0626","type":"http in","z":"e54fc8b3.8e44a","name":"","url":"/insert","method":"post","upload":false,"swaggerDoc":"","x":170,"y":380,"wires":[["c4bf7a5f.7cf5e8"]]},{"id":"85d4d110.766098","type":"function","z":"e54fc8b3.8e44a","name":"insert-response","func":"msg.payload=msg.result;\nreturn msg;","outputs":1,"noerr":0,"x":795,"y":380,"wires":[["c58e2c8b.b56eb"]]},{"id":"c4bf7a5f.7cf5e8","type":"function","z":"e54fc8b3.8e44a","name":"insert-query","func":"msg.topic=\"INSERT INTO test (name,lastname,code,married,timestamp) VALUES ('\" + msg.payload.name + \"','\" + msg.payload.lastname + \"','\" + msg.payload.code + \"','\" + msg.payload.married + \"',CURRENT_TIMESTAMP)\";\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":380,"wires":[["af7efda4.25e76"]]},{"id":"c58e2c8b.b56eb","type":"http response","z":"e54fc8b3.8e44a","name":"","x":1140,"y":380,"wires":[]},{"id":"509d9291.b4fbe4","type":"function","z":"e54fc8b3.8e44a","name":"lastname-query","func":"msg.topic=\"SELECT id, prijmeni as value FROM osoby\";\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":320,"wires":[["41fb0432.ae0d14"]]},{"id":"1e0ea52c.8ebfcb","type":"function","z":"e54fc8b3.8e44a","name":"lastname-response","func":"return msg;","outputs":1,"noerr":0,"x":805,"y":320,"wires":[["f5f11c20.f1a2"]]},{"id":"42dd1bd9.5c139c","type":"http in","z":"e54fc8b3.8e44a","name":"","url":"/search/lastname","method":"get","upload":false,"swaggerDoc":"","x":200,"y":320,"wires":[["509d9291.b4fbe4"]]},{"id":"16ec1466.64dfbc","type":"http response","z":"e54fc8b3.8e44a","name":"","statusCode":"","headers":{},"x":1140,"y":320,"wires":[]},{"id":"f5f11c20.f1a2","type":"json","z":"e54fc8b3.8e44a","name":"","property":"payload","action":"","pretty":false,"x":990,"y":320,"wires":[["16ec1466.64dfbc"]]},{"id":"98c569a.b1bf618","type":"http in","z":"e54fc8b3.8e44a","name":"","url":"/delete","method":"post","upload":false,"swaggerDoc":"","x":170,"y":500,"wires":[["6689f64b.7def8"]]},{"id":"24f2d2d1.af0066","type":"function","z":"e54fc8b3.8e44a","name":"delete-response","func":"msg.payload=msg.result;\nreturn msg;","outputs":1,"noerr":0,"x":795,"y":500,"wires":[["a884a9de.a9b2e"]]},{"id":"6689f64b.7def8","type":"function","z":"e54fc8b3.8e44a","name":"delete-query","func":"msg.topic=\"DELETE FROM test WHERE id='\" + msg.payload.id + \"'\";\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":500,"wires":[["f6964e20.a2a248"]]},{"id":"a884a9de.a9b2e","type":"http response","z":"e54fc8b3.8e44a","name":"","x":1140,"y":500,"wires":[]},{"id":"6012b9f0.a248a8","type":"http in","z":"e54fc8b3.8e44a","name":"","url":"/update","method":"post","upload":false,"swaggerDoc":"","x":170,"y":440,"wires":[["13e07319.fa7145"]]},{"id":"8b7d1e7b.5eca28","type":"function","z":"e54fc8b3.8e44a","name":"update-response","func":"msg.payload=msg.result;\nreturn msg;","outputs":1,"noerr":0,"x":805,"y":440,"wires":[["c7eb096b.1a91f"]]},{"id":"13e07319.fa7145","type":"function","z":"e54fc8b3.8e44a","name":"update-query","func":"msg.topic=\"UPDATE test SET name='\" + msg.payload.name + \"', lastname='\" + msg.payload.lastname + \"', code='\" + msg.payload.code + \"', married='\" + msg.payload.married + \"' WHERE id='\" + msg.payload.id + \"'\";\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":440,"wires":[["73184442.7a9dac"]]},{"id":"c7eb096b.1a91f","type":"http response","z":"e54fc8b3.8e44a","name":"","x":1140,"y":440,"wires":[]},{"id":"40889cea.27b78c","type":"sqlite","z":"e54fc8b3.8e44a","mydb":"9223e607.fc8c28","sqlquery":"msg.topic","sql":"","name":"wtest","x":590,"y":260,"wires":[["76cbf918.168de8"]]},{"id":"65ef894a.2ef98","type":"debug","z":"e54fc8b3.8e44a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1310,"y":300,"wires":[]},{"id":"41fb0432.ae0d14","type":"sqlite","z":"e54fc8b3.8e44a","mydb":"9223e607.fc8c28","sqlquery":"msg.topic","sql":"","name":"wtest","x":590,"y":320,"wires":[["1e0ea52c.8ebfcb"]]},{"id":"af7efda4.25e76","type":"sqlite","z":"e54fc8b3.8e44a","mydb":"9223e607.fc8c28","sqlquery":"msg.topic","sql":"","name":"wtest","x":590,"y":380,"wires":[["85d4d110.766098"]]},{"id":"73184442.7a9dac","type":"sqlite","z":"e54fc8b3.8e44a","mydb":"9223e607.fc8c28","sqlquery":"msg.topic","sql":"","name":"wtest","x":590,"y":440,"wires":[["8b7d1e7b.5eca28"]]},{"id":"f6964e20.a2a248","type":"sqlite","z":"e54fc8b3.8e44a","mydb":"9223e607.fc8c28","sqlquery":"msg.topic","sql":"","name":"wtest","x":590,"y":500,"wires":[["24f2d2d1.af0066"]]},{"id":"9223e607.fc8c28","type":"sqlitedb","z":"","db":"/root/.node-red/sqlite/wtest.sqlite3","mode":"RWC"}]
- sqlite database I am using is here
- Data is selected/imported properly - debug node is printing data in to the debugger window when I access the page https://myservername:1880/mytable ("/mytable" path is specified in the "http in" node)
- number of data rows is correct (9 records in the database)
The problem: CRUD table is empty (see printscreen below)