ember-examples-jquery-sortable icon indicating copy to clipboard operation
ember-examples-jquery-sortable copied to clipboard

This approach won't work with Ember.js 1.8

Open lepolt opened this issue 10 years ago • 5 comments

FYI, for those that may find this post...this approach doesn't work perfectly with Ember 1.8 and jQuery...when jQuery modifies the DOM, it messes with Ember's knowledge of what it thinks the DOM is and should be.

In the simple case, using a CollectionView instead of {{#each}} will work.

lepolt avatar Nov 21 '14 14:11 lepolt

@lepoltj Do you have an example using CollectionView for 1.8?

DEfusion avatar Dec 17 '14 15:12 DEfusion

Nevermind I figured it out, thanks for the tip @lepoltj

DEfusion avatar Dec 17 '14 15:12 DEfusion

Here is an example using Collection View, someone asked for but the comment has been deleted since

http://emberjs.jsbin.com/qehiqu/3/edit

DEfusion avatar Dec 23 '14 21:12 DEfusion

I've asked, but I managed to refactor this to CollectionView according to your answer(thanks!). But when I update item order, updates to DOM aren't smooth. I guess whole view is being re-rendered. Have you got any solution to this issue? @DEfusion

e00dan avatar Dec 24 '14 01:12 e00dan

@Kuzirashi I've experienced the same thing, it depends on how complex your item view/template is or how many items you have in your collection. I tried some of the different events that jquery sortable provides to see if that would smooth things out but didn't find a solution.

DEfusion avatar Dec 29 '14 14:12 DEfusion