Support disabling rows

This commit is contained in:
Vincent Fiduccia 2019-08-13 15:00:36 -07:00
parent 8f0eb396a3
commit 8f22791e9d
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
1 changed files with 5 additions and 6 deletions

View File

@ -18,7 +18,7 @@ function toggleInput(node, on) {
if ( id ) { if ( id ) {
let input = $(`input[nodeid="${id}"]`); // eslint-disable-line let input = $(`input[nodeid="${id}"]`); // eslint-disable-line
if ( input && input.length ) { if ( input && input.length && !input[0].disabled ) {
// can't reuse the input ref here because the table has rerenderd and the ref is no longer good // can't reuse the input ref here because the table has rerenderd and the ref is no longer good
$(`input[nodeid="${id}"]`).prop('checked', on); // eslint-disable-line $(`input[nodeid="${id}"]`).prop('checked', on); // eslint-disable-line
@ -557,13 +557,11 @@ export default Component.extend(Sortable, StickyHeader, {
if ( value ) { if ( value ) {
this.toggleMulti(content, []); this.toggleMulti(content, []);
return true;
} else { } else {
this.toggleMulti([], content); this.toggleMulti([], content);
return false;
} }
return get(this, 'selectedNodes.length') === get(this, 'pagedContent.length');
} }
}), }),
@ -613,8 +611,9 @@ export default Component.extend(Sortable, StickyHeader, {
} }
let nodeId = tgtRow.find('input[type="checkbox"]').attr('nodeid'); let nodeId = tgtRow.find('input[type="checkbox"]').attr('nodeid');
let check = tgtRow.find('input[type="checkbox"]')[0];
if ( !nodeId ) { if ( !nodeId || !check || check.disabled ) {
return; return;
} }