I dont know what is wrong .. it was working for me ..
what about the console log ? did you check it in the browser ?
i kept working on the code before your reply and i refactored the code a bit.
i was thinking that there is no need to create so many data attributes and i changed it to just one that has the json information, in order to parse it later and send it all at once ..
<div class="main">
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#D0D0D0" id="Table1" style="width:100%">
<tr class="fondotitulo">
<th>Marca</th>
<th>Vencimiento</th>
<th>Modelo</th>
<th>Id</th>
<th>✔</th>
</tr>
<tr ng-repeat="x in msg.payload | limitTo:100">
<td class="fondotabla" style="text-align:center;">{{x.Marca}}</td>
<td class="fondotabla" style="text-align:center;">{{x.Vencimiento}}</td>
<td class="fondotabla" style="text-align:center;">{{x.Modelo}}</td>
<td class="fondotabla" style="text-align:center;">{{x.id}}</td>
<td class="fondotabla" style="text-align:center;">
<input data-json="{{x}}" type="checkbox"/>
</td>
</tr>
</table>
</div>
<input type="button" value="Get Selected" style="margin-top:10px;" onclick="check()" />
<script type="text/javascript">
//Declare once to make scope available in functions
var theScope = scope;
function check() {
//Reference the Table.
var grid = document.getElementById("Table1");
//Reference the CheckBoxes in Table.
var checkBoxes = Array.from(grid.getElementsByTagName("INPUT"));
//console.log(checkBoxes)
let selected = []
//Loop through the CheckBoxes.
checkBoxes.forEach( cb => {
if (cb.checked) {
var json = cb.dataset.json;
selected.push( JSON.parse(json) )
}
})
console.table(selected)
theScope.send({payload:selected}) // send payload of selected to NR
}
</script>
Flow :
[{"id":"7e1bacaca148f617","type":"inject","z":"4895ea10b4ee9ead","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"Marca\":\"Marca1\",\"Vencimiento\":\"Vencimiento1\",\"Modelo\":\"Modelo1\",\"id\":1},{\"Marca\":\"Marca2\",\"Vencimiento\":\"Vencimiento2\",\"Modelo\":\"Modelo2\",\"id\":2},{\"Marca\":\"Marca3\",\"Vencimiento\":\"Vencimiento3\",\"Modelo\":\"Modelo3\",\"id\":3},{\"Marca\":\"Marca4\",\"Vencimiento\":\"Vencimiento4\",\"Modelo\":\"Modelo4\",\"id\":4},{\"Marca\":\"Marca5\",\"Vencimiento\":\"Vencimiento5\",\"Modelo\":\"Modelo5\",\"id\":5}]","payloadType":"json","x":170,"y":740,"wires":[["7b27e8162f964804"]]},{"id":"7b27e8162f964804","type":"ui_template","z":"4895ea10b4ee9ead","group":"be1716dc44c27277","name":"","order":0,"width":"12","height":"14","format":"<div class=\"main\">\n\n <table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#D0D0D0\" id=\"Table1\" style=\"width:100%\">\n <tr class=\"fondotitulo\">\n <th>Marca</th>\n <th>Vencimiento</th>\n <th>Modelo</th>\n <th>Id</th>\n <th>✔</th>\n\n </tr>\n <tr ng-repeat=\"x in msg.payload | limitTo:100\">\n\n <td class=\"fondotabla\" style=\"text-align:center;\">{{x.Marca}}</td>\n <td class=\"fondotabla\" style=\"text-align:center;\">{{x.Vencimiento}}</td>\n <td class=\"fondotabla\" style=\"text-align:center;\">{{x.Modelo}}</td>\n <td class=\"fondotabla\" style=\"text-align:center;\">{{x.id}}</td>\n <td class=\"fondotabla\" style=\"text-align:center;\">\n <input data-json=\"{{x}}\" type=\"checkbox\"/>\n </td>\n </tr>\n </table>\n\n</div>\n\n<input type=\"button\" value=\"Get Selected\" style=\"margin-top:10px;\" onclick=\"check()\" />\n\n\n<script type=\"text/javascript\">\n //Declare once to make scope available in functions\nvar theScope = scope;\n\n\n function check() {\n //Reference the Table.\n var grid = document.getElementById(\"Table1\");\n \n //Reference the CheckBoxes in Table.\n var checkBoxes = Array.from(grid.getElementsByTagName(\"INPUT\"));\n //console.log(checkBoxes)\n \n let selected = []\n //Loop through the CheckBoxes.\n checkBoxes.forEach( cb => {\n if (cb.checked) {\n var json = cb.dataset.json;\n selected.push( JSON.parse(json) )\n }\n })\n \n\n console.table(selected)\n theScope.send({payload:selected}) // send payload of selected to NR\n\n }\n \n</script>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","x":340,"y":740,"wires":[["f031ce5e80e92150"]]},{"id":"f031ce5e80e92150","type":"debug","z":"4895ea10b4ee9ead","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":740,"wires":[]},{"id":"be1716dc44c27277","type":"ui_group","name":"Default","tab":"4d0a4c2538b36c79","order":1,"disp":true,"width":"12","collapse":false},{"id":"4d0a4c2538b36c79","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]