Disabling row selectors while inline-editing

Disabling row selectors while inline-editing

womplifywomplify Posts: 30Questions: 3Answers: 0

Sorry to be a stickler for little details.. But there is something I find a little annoying, interface-wise, and I wanted to share an see what might constitute an elegant solution..

I've implemented an inline-editing, enabled via double-click, in certain tables which support row selection ('os' style multi-select, but the type is not really important).
..which already pose a problem, as double clicking the cell already causes a somewhat annoying behavior of selecting and deselecting the row.
But there is an even bigger "issue".
When the cell's value is a select, or checkbox for example, changing the value requires clicking on the input control.. which again causes select/deselect to happen.
This is highly annoying, to be honest. This behavior causes interface to look clunky. Especially since I use row selection to load a secondary table's "drilldown" data.

I couldn't find a way to control the behavior of row selection, so that I can better handle these scenarios.
First, I would have loved to only select rows on single clicks, rather than double clicks. I know it is hard to tell if a click is "going to be" a double click, as the click event is fired anyway on the first click in a double-click. But regardless, the behavior of it is annoying, I must say.
Second, and this one at least should be able to "fix".. inline-editing clicks on the input-controls, should NOT cause row select/deselect. BUT I couldn't find a way to abort row-selection/deselection if the click is done on an input field.
It would have been nice if it either did that already by default, or if I could abort a row selection/deselection if the event was triggered from an input field, and only allow it to take effect it if was done from the cell's "background" itself.

Any chance I am missing something and the two issues CAN be solved?
Best,
Ron

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Hi Ron,

    Thanks for your message. Certainly inline editing with row selection is a difficult subject. In many of my examples I took the approach of using a single column "checkbox" to act as the row select rather than using click / dblclick. The reason for that is that there is no reliable way to distinguish between the two. The best that could be done is to have a click event with a setTimeout that will tell you if you should take the click or double click action (nasty).

    The other option is that you could have a "flag" that tells your the row selector event handler if the cell is open for editing or not (triggered by the open and close events) - this would require use of fnPreRowSelect, which isn't ideal, but it would work.

    Regards,
    Allan

This discussion has been closed.