Hi Team,
I want to enable only drag functionality in grid and not drop?
and In tree only allow drop functionality and not drag.
How to do it?
Thanks
-Agile
Please, see the article dhtmlx.com/docs/products/dht … _Drop.html
You can try to use onDrag event handler:
grid.attachEvent(“onDrag”,function(sid,tid,bid,sobj,tobj){
if(tobj == grid) return false
return true
})
tree.attachEvent(“onDrag”,function(sid,tid,bid,sobj,tobj){
if(sobj == tree) return false
return true
})
grid.attachEvent(“onDragIn”,function(sid,tid,sobj,tobj){
if(tobj == grid) return false
return true
})
The full list of events can be found in the documentaiton:
dhtmlxGrid/doc/events.html
dhtmlxTree/doc/events.html
Based on your code example, how do I actually determine if it is a “grid”? When I break into debug mode in JavaScript and show my locals variables, I do not see a “type” property or anything similiar that I could use to determine if tobj == grid.
grid.attachEvent(“onDragIn”,function(sid,tid,sobj,tobj){
if(tobj == grid) return false
return true
})
when dragging into the grid I see a dragContext.source and dragContext.target that I can use, but when I drag from tree to tree I do not get that property.
Based on your code example, how do I actually determine if it is a “grid”?
The sobj and tobj are references to the component objects, you can compare them with known instances of tree
grid.attachEvent(“onDragIn”,function(sid,tid,sobj,tobj){
if(tobj == grid) return false
here grid is no a some special name - but real variable used for storign reference of grid object.
>> I do not see a “type” property or anything similiar that I could use to determine if tobj == grid.
Its not part of public api, but you can use
if (tobj.mytype==“tree”) action_for_tree();
else action_for_grid();
>>when dragging into the grid I see a dragContext
dragContext is a grid specific object, there is no such object available for d-n-d operation in tree.