Button click event not firing inside datatable
Button click event not firing inside datatable
nickolojon
Posts: 20Questions: 0Answers: 0
Hi
I have a datatable with a button column with an onclick event attached to it, but it seems that the onclick event is not firing and the function was never called. I noticed that when passing a parameter that consists of multiple words with spaces it doesn't fire but when an integer or a string with no spaces the onclick will fire and the function will be called. Please see the initialization code below for your reference.
------list of JSON data to be transfered to array
for (var i = 0; i < arrayOfJSON.length; i++) {
childArr = new Array();
var arr = $.parseJSON(arrayOfJSON[i]);
childArr.push('');
childArr.push(arr.jsonProperty1);
childArr.push(arr.jsonProperty2);
childArr.push(arr.jsonProperty3);
childArr.push(arr.jsonProperty4);
parentArr.push(childArr);
}
*sample of a single array that represents a single row in the table
[,title,description,text,text]
-------- table initialization after transfer of JSON data to array
var oTable = $('#x').dataTable({
"aaData": arrayOfArrays
});
----function looks like this
function takeExam(param1, param2, param3, param4,param5) {
$("#1").val(param1);
$("#2").val(param2);
$("#3").val(param3);
$("#4").val(param4);
$("#dialog").dialog("open");
}
Please help... thanks in advance
I have a datatable with a button column with an onclick event attached to it, but it seems that the onclick event is not firing and the function was never called. I noticed that when passing a parameter that consists of multiple words with spaces it doesn't fire but when an integer or a string with no spaces the onclick will fire and the function will be called. Please see the initialization code below for your reference.
------list of JSON data to be transfered to array
for (var i = 0; i < arrayOfJSON.length; i++) {
childArr = new Array();
var arr = $.parseJSON(arrayOfJSON[i]);
childArr.push('');
childArr.push(arr.jsonProperty1);
childArr.push(arr.jsonProperty2);
childArr.push(arr.jsonProperty3);
childArr.push(arr.jsonProperty4);
parentArr.push(childArr);
}
*sample of a single array that represents a single row in the table
[,title,description,text,text]
-------- table initialization after transfer of JSON data to array
var oTable = $('#x').dataTable({
"aaData": arrayOfArrays
});
----function looks like this
function takeExam(param1, param2, param3, param4,param5) {
$("#1").val(param1);
$("#2").val(param2);
$("#3").val(param3);
$("#4").val(param4);
$("#dialog").dialog("open");
}
Please help... thanks in advance
This discussion has been closed.