Hi DevGiu,
I've managed to fix this problem now. But I'm a bit confused as there is no built-in js function called openDetailModal(). Is this a function that you have written? If so I'd love to have a copy of the code so I can get the Modal link working on my install too!
Anyway, this is the only way I could fix it - and I had to do it this way in order to bypass the code that strips the onClick tag. Here's what I did...
I edited tablename_init() and completely removed the method described above, e.g...
$old_options = $options->QueryFieldsTV;
foreach($old_options as $field => $caption){
/* Keep all fields as-is except for the phone field */
if($field == "IF(CHAR_LENGTH(`entidad1`.`ref`) || CHAR_LENGTH(`entidad1`.`nombreComercial`), CONCAT_WS('',`entidad1`.`ref`, '-', `entidad1`.`nombreComercial`), '') /* Entidad */"){
/* Display only the first four digits of the phone field */
$new_options["CONCAT('<a href=\'entidad_view.php?SelectedID=\'', `entidad1`.`id`, '\'>',`entidad1`.`nombreComercial`,'</a>')"] = $caption;
}else{
/* Keep all other fields as-is */
$new_options[$field] = $caption;
}
$options->QueryFieldsTV = $new_options;
}
And I replaced it with...
//Modify the Table View Template on-the-fly so that it includes the onClick event even after being overwritten
$NormalLink = "<%%VALUE(id)%%>";
$NewLink = "<a href='#' onclick=\"javascript:openDetailModal('entidad',<%%VALUE(id)%%>);return false;\"><%%VALUE(id)%%></a>";
//Read the template file contents
$str=file_get_contents('templates/tablename_templateTV.html'); //You need to change 'tablename_templateTV.html' to your table name
//Replace the normal link if it exists with the onClick version
$str=str_replace("$NormalLink", "$NewLink",$str);
//Write the changes to the server
file_put_contents('templates/attendance_templateTV.html', $str);
The template file itself is tiny so there is hardly any server load using this method. And the great thing is that even when you regenerate the template file via AppGini, it always gets updated on the server when you view the table.
Now, about that openDetailModal() code!...
