onRowSelect doesn't work when a row is already selected

It looks like a couple ppl have posted on this but I didn’t see any responses to their posts. Is this just a bug that we have to live with or is there a way around this problem. It’s really annoying to have to click off the row only to select it again. Any help on this is appreciated.

Thanks!

No responses on this at all? Is this a known bug or not? I just need to know where I stand with this. If this is a known bug what are my options to get around it. What is everyone else doing? Is there another option besides onRowSelect that would work better? I need help getting around this, this project is almost done. Thanks!

Have same problem here.

Such issue was fixed.
Please, contact support@dhtmlx.com and we’ll provide you a fixed version.

We actually encountered this same problem when working with the grid. Here’s how we modified the code to make this work as expected.

In dhtmlxgrid.js, find the following function declaration:

this.doClick=function(el, fl, selMethod, show){

Look for this block of code, about halfway down in the function:

} else if (selMethod == 2){ if (el.parentNode.className.indexOf("rowselected") != -1){ el.parentNode.className=el.parentNode.className.replace(/rowselected/g, ""); this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode)) var skipRowSelection = true; } } this.editStop();
We need to handle the case where the row has already been selected. Change this block of code to be the following (inserting a new “else if” statement code block):

} else if (selMethod == 2){ if (el.parentNode.className.indexOf("rowselected") != -1){ el.parentNode.className=el.parentNode.className.replace(/rowselected/g, ""); this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode)) var skipRowSelection = true; } } else if(el.parentNode.className.indexOf("rowselected") !== -1) { this.clearSelection(); return this.doClick(el, fl, 0, show); } this.editStop();

This will make selections work as expected on rows that have already been selected.

1 Like