Hi,
I am passing data into html content and it is displaying an working fine, besides that i have array of data where will be rendered in table and to do that i have added <script> before the end of the body and i implemented for loop as follow:
.....
<script>
var trs = '';
var RowsData = ${data.RowsData};
for (var i = 0; i <= RowsData.length; i++) {
trs += '<tr> <td> i.balance </td> <td> i.ForAmount</td> <td> i.FromAmount</td> <td> i.Note</td> <td>i.Date </td> <td> i.id</td> </tr>'
}
document.getElementById('rowsData').insertAdjacentHTML('afterbegin', trs);
</script>
</body>
</html>
But the issue is that the var RowsData is always empty and data is not rendered as <tr>
I have tried to put the script within the <head> but still not working.
when i assign data to var RowsData directly not from props passed, it works fine.
I don't know how to make this work. i hope someone can help or have workaround for this.
Hi, I am passing data into html content and it is displaying an working fine, besides that i have array of data where will be rendered in table and to do that i have added
<script>
before the end of the body and i implemented for loop as follow:But the issue is that the
var RowsData
is always empty and data is not rendered as<tr>
I have tried to put the script within the<head>
but still not working.when i assign data to
var RowsData
directly not from props passed, it works fine.I don't know how to make this work. i hope someone can help or have workaround for this.