Custom HTML - JavaScript getGridCellValues - copy data from child to parent table
Confluence User - 05 May, 2016
Hi All,
I have used below code to copy data from grid table to parent table (into speciefic field), it returns all grid data in an array.
How can I modify below code to have in parent table field Parent1 only speciefic record from Grid table field2, eg. only 3rd record so when i = 3 which means result 145.
Thanks for help in this one.
<script type="text/javascript">
$(document).change(function(){
//this is field in parent table
var fieldId1 = "parent1";
//get value from parent form
var values1 = FormUtil.getGridCellValues("grid.field2");
for (var i = 0; i < values1.length; i++) {
console.log(values1[i]); //i equals to row number start from 0
}
//store the value to a parent table field
$('[name='+fieldId1+']:enabled').val(values1);
});
</script>
javascript;html;forms
