Currently I have data table which has child rows as well , In child rows one of my column having the href link and I have the following onClick event to it.
File1.js
var empObj = {'name' : "Abc"};
var cell = row.insertCell(-1);
var hrefLink = document.createElement('a');
hrefLink.setAttribute('href',"#");
hrefLink.setAttribute('id',"all");
hrefLink.setAttribute('onClick',"window.open('/App/home/happyPath', '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,top=300,left=60,width=1100,height=650')");
hrefLink.innerHTML = "ALL";
cell.appendChild(hrefLink);
cell.style.textAlign = "center";
row.appendChild(cell);
In above code snippet its creating the href element and aim getting in the child rows and Also on click its opening new window with target html.
But its open the new window I'm laoding File2.js from thymleaf script tag <script th:src="@{/resources/build/js/File2.js(v=${startUpTime})}" />
Now here in File2.js I wanted to use the variable empObj from the File1.js for other data manipulation and computation.
Can anyone please help on this.
via Tanveer
No comments:
Post a Comment