input type checkbox on disable attribute

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
Leving Tinoco
Posts: 12
Joined: 2018-01-04 18:39
Location: Canada

input type checkbox on disable attribute

Post by Leving Tinoco » 2020-11-25 06:57

juts a suggestion for the input type checkbox went the table in read-only (not editable).

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>";
};
and table-dv.js

Code: Select all

var readOnly = $j('[name=readOnly]').val();

    if (readOnly)
    {
        $j(':checkbox').prop('disabled', false);
        $j(':checkbox').attr('onclick', 'return false;');
    }
thanks

Post Reply