mirror of https://github.com/rancher/ui.git
Support disabling rows
This commit is contained in:
parent
8f0eb396a3
commit
8f22791e9d
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue