I have this code -
class TableManager
tables : {}
tableViews :{}
nextId : 0
rootEl : 'body'
addTable:(json,el)->
newTableModel = new TableModel(json,@nextId)
newTableModel
@tables[@nextId] = newTableModel
el = "#table1"
newView = new TableView({model : newTableModel, columns : json["Columns"], el : el, id : @nextId})
@tableViews[@nextId] = newView
newTableModel.renderModel()
@nextId++
class TableView extends Backbone.View
tableId : ''
columns : ''
thead : ''
tbody : ''
input : ''
rows : ''
inputId : ''
typingTimer : ''
doneTypingInterval : 2000
el : '#table1'
initialize:()->
@model.bind "render", @render
@tableId = "resultsTable#{@options.id}"
@inputId = "filterInput#{@options.id}"
@columns = @options.columns
render:()=>
console.log "EL"
console.log $(@el)
console.log @el
The console.log @el is always undefined. I don't know why, I'm setting this.el correctly I thought? Is it because render is being called as a result of an event firing?