1 Reply Latest reply on Apr 7, 2015 11:19 AM by Preran

    How do I attach a callback to a element created using createChildSymbol()

    aju55621059

      I have drag functionality in which I want to create a custom helper so I am using a helper function that would create a element based on a symbol.  The created element has a call back that when swiped left will be destroyed.  but the callback is once in a while ( 1 out of 20 times). Here is my code snippet:

       

      sym.$('.draggable').draggable({ containment: "Parent",

        helper: function(){

        var dom = [];

                  // Create an instance element of a symbol as a child of the

        // given parent element

        var copyOfSym = sym.createChildSymbol($(this).attr("id").replace("Stage_Redux_","") , "Stage");

        copyOfSym.getSymbolElement().bind('swipeleft', function(event){

                                                                                         $(this).remove();

                                                                              });

       

      The 'swipeleft'  does not get called consistently.

       

      What am I doing wrong?

       

      Thanks