Angular-gridster2: resizable/draggable.stop callback should be able cancellable

Created on 27 Mar 2017  路  6Comments  路  Source: tiberiuzuld/angular-gridster2

Can you support promise/cancellable for the stop callback?
A simple use case is users want to rearrange the widget position but we want their confirmation(via popup dialog) before apply new position.

enhancement

Most helpful comment

Thank you, @tiberiuzuld. This helped me.

All 6 comments

Hi @nghiado,
It is possible, will implement it this week.

Hi @nghiado ,
Implemented this in v2.4.0

Thanks @tiberiuzuld, will try this weekend.

Can you please provide an example on how this callback should look like with the posibility to cancel it?

Hi @PeterSeifert ,
You need to return a promise from the callback like:

vm.options.draggable.stop = areYouSureCallback;

function areYouSureCallback(item, itemComponent, event){
     return new Promise(function(resolve, reject){
        /// do your stuff here
    });
}

Thanks,

Thank you, @tiberiuzuld. This helped me.

Was this page helpful?
0 / 5 - 0 ratings