I have created a view which supports drag and drop following the solution here. Now I am trying to set the drag image for each view based on its own content. Here is coffeescript for part of the code that I have issue with:
App.BlockView = Ember.View.extend(App.Draggable, {
classNames: ['block'],
mouseDown: ->
console.log "clicked on #{@get 'elementId'} block and thumbnail is #{@get 'block.thumbnail'}" #this works
,
dragIconElement: Em.View.create({
attributeBindings: ['src'],
tagName: 'img',
#src: @get 'block.thumbnail', #this does not work
src: @get 'parentView.block.thumbnail', #this does not work either
}).createElement().get('element')
...
})
As you can see I tried this solution, but it did not work. Here is the errors I get in both cases above:
TypeError: this.get is not a function
src: this.get('parentView.block.thumbnail')
I am using Ember 1.0pre1 I don’t know how to access parent level scope here, and there is probably something basic I am missing here. Any help would be appreciated.