Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by P. Recktenwald on Feb 18, 2008 10:10
open dhtmlx forum
Drag-and-drop error

I've discovered the following behavior in the drag-and-drop example of dhtmlxTreeGrid (v1.5):

If you drag a row from one grid to another (or within the same grid, does'nt matter) and hit the right mouse button before you drop the row, an error will occur which prevents the row from being dropped correctly afterwards. It seems that the right click event prevents the drag-and-drop code of dhtmlxTreeGrid from being executed correctly, so there even might be other events that could also interfere in this sitution if they occur.

Of course the example I gave is not a realistic scenario of user behavior, but one could accidentially hit the right mouse button in this situation. Is there a way to fix this to prevent users from (accidentally or intentionally) runnig into this error?

Thank you in advance
Answer posted on Feb 19, 2008 02:44
Problem confirmed and fixed. Fix will be released as part of next build.
If you need it ASAP - please contact us directly at support@dhtmlx.com and provide your ref. number.
Answer posted by P. Recktenwald on Feb 21, 2008 09:41
I received your fix. Thank you for that, but unfortunately it didn't solve the problem for me.

Could you please check if the problem is really fixed? If so, maybe I just got the wrong files.

Thank you.
Answer posted by Support on Feb 21, 2008 10:25
The problem can't be reconstructed anymore after latest fix.
Please be sure to update both provided files.

If problem still occurs for you - please send any kind of sample where it can be reconstructed ( you can send it directly to support@dhtmlx.com )
Answer posted by P. Recktenwald on Feb 21, 2008 14:42
That's strange because actually I can still reconstruct the problem with the drag and drop examples of dhtmlxGrid and dhtmlxTreeGrid even if both files are updated. The browser I use is Firefox 2.0.0.12.

Therefore I took the (non-modified) dhtmlxTreeGrid v1.5 package and updated both files. Then I cleared the browser cache as a precaution and opened the example "dhtmlxGrid\samples\drag_n_drop\drag_grid.html". Then I did exactly what I described in my first message. After hitting the right mouse button before dropping the row with the left mouse button, the following error occurs:

r2 has no properties
    if (r2.treeNod.isTreeGrid()) c.set("source","treeGrid");
    dhtmlxgrid_drag.js (line 315)

After that, the dragged node will stick to the cursor and can only be dropped outside the grid areas. But doing so will bring up the following error on any further mouse movement:

dragger.dragStartObject._createDragNode is not a function
    dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNod...
    dhtmlxcommon.js (line 294)

As this is exactly what happend before I updated the two files, I am not shure if I received the correct fix as you say the problem can't be reconstructed anymore after the latest fix.

Thank you for your efforts.
Answer posted by Support on Feb 22, 2008 02:27
In which browser problem occurs for you ?
Answer posted by P. Recktenwald on Feb 22, 2008 04:21
The error I described above appeared on Mozilla Firefox 2.0.0.12. Further testing with the updated files showed that the same error also appears on Microsoft Internet Explorer 7:
    Line:    316
    Char:    9
    Error:    'treeNod' is null or not an object
    Code:    0

(although the behavior of Microsoft IE 7 is slightly different compared to Firefox in error case)

I also tested Microsoft IE 7 without the fix and I noticed that no error occurs in this case!

Furthermore I've overlooked that in Firefox the error which appears with the updated files is not the same that appears without the fix. Sorry for that mistake. Without the fix, the error in Firefox is as follows:

r2 has no properties
   
if (this._autoOpenTimer)window.clearTimeout(this._autoOpenTimer);var r1=targetH...
    dhtmlxgrid_drag.js (line 16)
Answer posted by Support on Feb 22, 2008 08:57
Please check additional sample, which was sent by email, it contains updated dhtmlxcommon.js which must fix second issue as well.
Answer posted by P. Recktenwald on Feb 25, 2008 11:18
The additional sample with the updated dhtmlxcommon.js works perfectly.

Thank you very much!