Categories | Question details Back To List | ||
[dhtmlxTreeGrid] after On Drag 'false', dataprocessor doesn't catch insert event Hey guys, I've just bumped into a tricky issue that seems related to my previous one with Dataprocessor (http://dhtmlx.com/docs/products/kb/index.php?s=normal&q=8374&a=13161). To sum it up briefly : I have a grid and a treegrid component in layout panels. On treegrid, a dataprocessor is on with dnd option ( setUpdateMode("cell",true) ). Also on treegrid a have a custom function for 'onDrag' event which basically return false for some cases. Finally a have a 'newRow' button that create a new row (basic addRow function at the root of treegrid). Everything works fine with treegrid (create newRow, edit row, rearrange treegrid hierarchy and correct database update done by dataprocessor on each modification). A soon as I try to drop an item which return false to 'onDrag' Event, my create button still creates rows but Dataprocessor doesn't catch the event and thus doesn't insert new row in database. If I edit a row then, dataprocessor correctly catch the event and updates database. However 'create row' STILL broken. At last, if a move a branch or a node, dataprocessor catch event correctly again and process it. AND THEN AND ONLY THEN, 'create row' is NOT broken anymore ! Tha'ts a nasty one for sure ! Any help, please ? Answer posted by Support on Mar 13, 2009 11:24 It is related to usage of dp.setUpdateMode(some,true); when mode enabled dataprocessor ignores row deleting|creating operation which occurs during dnd, but to be correct it ignore ANY insert operation while d-n-d not finished. So if you add row directly from onDrag handler , it will be processed in same way - ignored. You can a) add row with 1ms timeout ( which will result in separate js thread execution, after dnd finished ) or b) use next code dp.setUpdateMode(some,false); //disable dnd block grid.addRow.... dp.setUpdateMode(some,true); Answer posted by n.darques on Mar 13, 2009 11:59 Thanks for your input. Thing is, deleting|creating operation works perfectly until I try to drag and drop a item from grid into treegrid. It is the value returned by 'onDrag' event that break deleting|creating dataprocessor operation. It seems that when it returns false a chain of events is not processed stopping dataprocessor to catch deleting|creating operation. Things goes back to normal after a that onDrag has returned again true value (in my case by 'dnd' a node inside hierarchy of treegrid). I could provide a simple stripped code for demonstration if necessary. Answer posted by Support on Mar 17, 2009 10:29 Problem confirmed, it was not directly related to dataprocessor. When dnd blocked through onDrag event, grid doesn't clears inner pointer to dnd related data structure, which used in some situations inside dataprocessor. To fix issue , just add next line before returning false from onDrag event this.dragContext=null; return false; |