I am trying to use javascript and a function to call a dynamic action. I would like to invoke this dynamic action whenever any of the three columns are updated in the interactive grid, the fourth column becomes the concatenated value of the values input in the three columns.
Please help me with syntax to be used to refer the column values by column name or id or lable and corrections. This is what I have done so far.
Page Level - Function and Global Variable Declaration
--------------------------------------------------------------------------------
function update_description() {
$('input[id="C4"]').each ( function concatenateDescription() {
var rowId = this.id;
var noun = $('#C1'+rowId).val();
var desc = $('#C2'+rowId).val();
var dim_spec = $('#C3'+rowId).val();
var final_desc = string.concat(noun, ',',desc, ',',dim_spec);
$('#C4'+rowId).val(final_desc);
});
}
Here C1, C2 and C3 are the static ids of the driving columns and C4 is the resultant column.
On page load, I run
update_description();
On each of the C1, C2 and C3 : custom attribute: onchange="concatenateDescription();"
The error that I get is that the function is being wrongly called (invalid reference .....)
Edited:
Actual error that I see in the console when I change a value in any of the columns is :
Uncaught ReferenceError: concatenateDescription is not defined at HTMLInputElement.onchange