Instead of using the attribute "disabled", it would be better to use a function attribute like "$j(':checkbox').attr('onclick', 'return false;');"
The problem I see is that when in read-only mode in details view, it is very difficult to see the checkbox. using return false; with onclick will be visible but not editable.
I add it some code to my project to force this.
to my table.php on hook folder I add
Code: Select all
if (!$table_perms['insert']) {
$html .= "<script>\n"
. " \$j('[name=myform]').append('<input name=\"ReadOnly\" value=1 type=\"hidden\">');\n"
. "</script>";
};
Code: Select all
var readOnly = $j('[name=readOnly]').val();
if (readOnly)
{
$j(':checkbox').prop('disabled', false);
$j(':checkbox').attr('onclick', 'return false;');
}