You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
After selecting 'banana' row with the mouse, console output is this:
["banana", 0, 4, 0]
However, after selecting 'apple', the output is this:
["banana", 0, 4, 0, Array[4]]
Array[4] is the 'apple' row which is appended as an element to the previously selected 'banana' row. Additionally selected rows will be appended in the same way.
The reason for this is the expression Array.isArray(this.selected) in various locations throughout the code, assuming that multiple-selection mode is active if this.selected contains an array.
The selected row is an array and after the first click, the selectedChange handler switches the selection mode to multiSelect - which it should not.
Since this.selected contains array data ('banana' row), method toggleRowFromSelected appends newly selected 'apple' row as an element.
Please also note that the 'check all' checkbox appears in the table header after the first selection, indicating the implicit mode switch from single- to multiple-selection mode.
So far, I commented out the code in selectedChanged and added a mode check in toggleRowFromSelected as follows:
toggleRowFromSelected: function (row) {
if (this.multiSelect && Array.isArray(this.selected)) {
var index = this.selected.indexOf(row);
...
This seems to fix the wrong construction of this.selected. However, in single-selection mode, checkboxes are now longer properly toggled.
The text was updated successfully, but these errors were encountered:
Defining table data as an array of arrays leads to wrong construction of the
selected
data if table is in single-selection mode.After selecting 'banana' row with the mouse, console output is this:
However, after selecting 'apple', the output is this:
Array[4]
is the 'apple' row which is appended as an element to the previously selected 'banana' row. Additionally selected rows will be appended in the same way.The reason for this is the expression
Array.isArray(this.selected)
in various locations throughout the code, assuming that multiple-selection mode is active ifthis.selected
contains an array.selectedChange
handler switches the selection mode tomultiSelect
- which it should not.this.selected
contains array data ('banana' row), methodtoggleRowFromSelected
appends newly selected 'apple' row as an element.Please also note that the 'check all' checkbox appears in the table header after the first selection, indicating the implicit mode switch from single- to multiple-selection mode.
So far, I commented out the code in
selectedChanged
and added a mode check intoggleRowFromSelected
as follows:This seems to fix the wrong construction of
this.selected
. However, in single-selection mode, checkboxes are now longer properly toggled.The text was updated successfully, but these errors were encountered: