What are the normal return values of $dragCreate and $dragDestroy

My current dragCreate and dragDestroy:

$$('MyWebixTree').$dragCreate = function() {
if (myVariable == false)
return false
else
// proceed normally ???
}

Leaving it blank or returning true don't work.

Thank you

Comments

  • edited October 2019

    Hello @JimmyWang,

    Could you please elaborate on the expected behaviour?

    From what I can see, you are trying to prevent the drag inside of a tree component upon meeting a certain condition (judging by the "MyWebixTree" id), is that correct? In general, I'd recommend using the onBeforeDrag event for that: https://snippet.webix.com/vqmbsxjl.

    What concerns your example, the tree component doesn't have its own $dragCreate method. By specifying the $dragCreate function you are overriding the default drag handlers of the tree, which is why it works in general.

    What are the normal return values of $dragCreate

    Basically, this method allows you to create an HTML element that will be assigned to the drag event, which would also be the return value of this method.

    For instance, this example would work with a dashboard, since it does have its own $dragCreate: https://snippet.webix.com/37juf31t.

  • Thank you Dzmitry, putting my code in onBeforeDrag worked perfectly.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!