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
Hey guys, I feel like I'm making a meal out of some of the problems I'm having. Just looking for some advice.
Setup
I'm applying SelectionArea to a standard table.
The tables first few columns are none selectable with the remaining td's then being selectable.
When dragging limit to cells in the selected row.
To achieve this I've been editing the boundaries before "beforestart" is triggered.
Is editing the boundaries the correct solution? is there a better solution to achieve this.
$('body').on('mousedown', '.selectable', function (a) {
selection._options.boundaries = $(this).closest('tr').get(0);
});
border-collapse initial out of bounds.
When border-collapse is initial and border-spacing is 0, with the boundaries set to the closest tr it's just ever so narrowly selecting the cells from the row just above and just below the selected row. If i remove border-spacing thus setting it to its default value the cell selections are fine but when the value is 0 this is when the problem occurs.
If border-collapse is set to collapse i don't get this issue but I must use initial due to some sticky columns and header relying on this.
Disable de-selection when re-clicking the same single cell (unless ctrl is held)
Within "beforeStart" i've been using the following to prevent the cell from being deselected.
However this also causes a problem when trying to re-select a single cell and click drag into a range selection.
Any idea's what is the best way to prevent single cell de-selection but not interfere with dragging operation.
// prevent de-selection of single cell unless ctrl is held
var target = $(e.event.target);
var selectedTd = target.closest('td');
if (a.store.stored.length == 1 && selectedTd.is(a.store.stored[0]) && !a.event.ctrlKey) {
return false;
}
Shift clicking selects previous row, need more excel like behavior
Unlike 1) and 2) which limited boundaries to a single row. When no row limitation is enforced, so just all row cells can be selected. If I click cell A1 then shift click cell C3 I just want 9 cells to be selected. At the minute it will select all cells from the row 1 after the initial selection, all of row 2 then all of row 3 up until the selected cell.
How do i make shift selection act more like the the regular click drag selection / excel like.
This discussion was converted from issue #251 on August 04, 2025 15:26.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys, I feel like I'm making a meal out of some of the problems I'm having. Just looking for some advice.
Setup
I'm applying SelectionArea to a standard table.
The tables first few columns are none selectable with the remaining td's then being selectable.
To achieve this I've been editing the boundaries before "beforestart" is triggered.
Is editing the boundaries the correct solution? is there a better solution to achieve this.
When border-collapse is initial and border-spacing is 0, with the boundaries set to the closest tr it's just ever so narrowly selecting the cells from the row just above and just below the selected row. If i remove border-spacing thus setting it to its default value the cell selections are fine but when the value is 0 this is when the problem occurs.
If border-collapse is set to collapse i don't get this issue but I must use initial due to some sticky columns and header relying on this.
Within "beforeStart" i've been using the following to prevent the cell from being deselected.
However this also causes a problem when trying to re-select a single cell and click drag into a range selection.
Any idea's what is the best way to prevent single cell de-selection but not interfere with dragging operation.
Unlike 1) and 2) which limited boundaries to a single row. When no row limitation is enforced, so just all row cells can be selected. If I click cell A1 then shift click cell C3 I just want 9 cells to be selected. At the minute it will select all cells from the row 1 after the initial selection, all of row 2 then all of row 3 up until the selected cell.
How do i make shift selection act more like the the regular click drag selection / excel like.
Thanks for any help guys
Beta Was this translation helpful? Give feedback.
All reactions