ui-sortable icon indicating copy to clipboard operation
ui-sortable copied to clipboard

ui.item.scope().item undefined

Open edamron opened this issue 11 years ago • 6 comments

I'm attempting to determine which item on scope was cancelled, using the example on the github page, but 'scope()' is always undefined:

$scope.sortableOptions = { update: function(e, ui) { // "scope()" below is always undefined if (ui.item.scope().item == "can't be moved") { ui.item.sortable.cancel(); } } };

What am I doing wrong?

Thanks

edamron avatar Feb 04 '15 00:02 edamron

+1

ilyadoroshin avatar Feb 04 '15 03:02 ilyadoroshin

Try using ui.item.sortable.model. What version of angular & ui-sortable are you using? Do you also use debugInfoEnabled(false)?

On Wed, Feb 4, 2015, 05:39 ilyadoroshin [email protected] wrote:

+1

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ui-sortable/issues/329#issuecomment-72785233 .

thgreasi avatar Feb 04 '15 05:02 thgreasi

'ui.item.sortable.model' works perfectly!! This gives me a direct reference to the item on scope that was moved to another position.

Thanks!!

edamron avatar Feb 04 '15 15:02 edamron

Do you also use debugInfoEnabled(false)?

I will update README and the code examples and close this issue.

On Wed, Feb 4, 2015, 17:51 Earl Damron [email protected] wrote:

'ui.item.sortable.model' works perfectly!! This gives me a direct reference to the item on scope that was moved to another position.

Thanks!!

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ui-sortable/issues/329#issuecomment-72878965 .

thgreasi avatar Feb 04 '15 16:02 thgreasi

I have used both debugInfoEnabled(false) and debugInfoEnabled(true) in my current app. At the moment, it's set to true.

Thanks again.

edamron avatar Feb 04 '15 16:02 edamron

Closed by 0ef26b63f0379616c60bfe2d66ccc6a196cb6066

thgreasi avatar Feb 04 '15 18:02 thgreasi