Batmanjs Custom View

Posted . Visible to the public.
class App.AutocompleteView extends Batman.View
  html: "<input type='text' />"
  autocompleteSource: -> []
  viewDidAppear: ->
    # I had to replace @node (as it is in the official documentation) to @node.firstChild since that is <input type='text' />
    # @node in my experiment is <div class="large-12 columns> 
    $(@node.firstChild).autocomplete
      source: @autocompleteSource()

HTML template:


Correct me if you know better way

Bonyiii
Posted by Bonyiii to Bonyiii's deck (2014-04-07 21:06)