oria / gridx

Just another powerful Dojo grid
Other
162 stars 78 forks source link

Row Selection does not work correctly in Gridx on double click #440

Open tansihede opened 3 years ago

tansihede commented 3 years ago

Hi Team,

We are using Gridx in one of our application and are facing below issue during row selection in Grid

Steps to reproduce issue-

  1. Select the first row in the grid by mouse double click and change the value from dropdown which is bound to one of the column in the grid.
  2. Next select the second row in the grid by mouse double click
  3. This time the mouse pointer will skip the second row and jump to the third row instead of jumping on the second row.

Expected Behavior: Mouse pointer should jump correctly on the selected row which in above case should be the second row.

Could anyone help if this is known issue of Gridx code. Is there any way or code fix or any alternate solution by which we can solve the issue?

Issue Reproducible on

I suspect the issue is coming from _onSelectionChange() function from gridx/modules/extendedSelect/_Base.js file which calls getSelected() function from gridx/modules/extendedSelect/Row.js to get the selected rows that returns two selectedIds instead of returning the single Id thus affecting the selection.

Any kind of input pointers/suggestions would be highly appreciated.

Thanks, Tansi

RobertKDavis commented 3 years ago

I think there is more going on than just Gridx. Does this happen on any row or only the first? I do not understand the drop down and how it interacts with your grid and what does the dropdown "onChange" do? Double Click? Isn't single click select?

You will want to look at the dropdown onChange and how you have rowDblClick and rowClick defined on the grid. gridx.on("rowDblClick", function(e){ console.log("rowDblClick Fired"); ... gridx.on("rowClick", function(e){ console.log("rowClick Fired"); ...

My guess: the onChange does something and then selects the next row. This next selection happens after you already selected a different row and so your next row is 1 more.

tansihede commented 3 years ago

Thanks Robert for quick response !

Yes, the issue happens for other rows as well not only specific to first row. We have a Dropdown which is basically a cell widget bound to one of the column in gridx. To enable this cell editing we need to double click on the grid row.

Thanks, Tansi