Grid. How should I use function selectBlock()?


I need to set a ctrl+a functionality for grid. I write the code:


and when I press ctrl+a I obtain a js error:

Ok, I thought, “maybe it is an error in script” and I’ve replaced all entrances of “myGrid” to “this” in function dhtmlXGridObject.prototype.selectBlock
in my dhtmlxgrid.js.
After that when I press ctrl+a I’ve got another error:

When I debug I see that “1” is the value of gridData.getRowId(0).

What I’m doing wrong?

PS. When I explicitly call



function mySelectBlock(d,c,b,a)

is my re-implementation of dhtmlXGridObject.prototype.selectBlock, everything works

Also I think that in documentation page the order of parameters is wrong.

It should be

void selectBlock(number start_col,string/number start_row,number end_column,string/number end_row);

Am I right?

replacing all the “myGrid” with the “this” is the correct solution. This problem is already fixed in the latest version of the dhtmlxGrid.
The correct order of the selectBlock() method attributes is:
1 - start column index
2 - start row Id
3 - end column index
4 - end row Id