I am in the process of learning Backbone.js. I currently assume that if one is using Backbone.js then all client-side javascript/jQuery should be integrated with Backbone. From the various online tutorials I can see how Backbone works and understand its underlying principles.

But what about things like jQuery UI widgets? Should these also be integrated with Backbone.js? For example, I want to use the jQuery UI Autocomplete widget on a form field (See code below). How would I go about doing this with Backbone.js (or would one not bother using Backbone for such things)? It seems like Backbone 'Model' and 'Collection' wouldn't work with the jQuery Autocomplete Widget, since that kind of stuff is tied up within the jQuery UI Widget itself.

What is the standard practice for such things? The only thing I could think of was to create a view and then add the widget in the render function. But this doesn't really seem very Backbone-ish to me.

define [
'jquery'
#if you're using requirejs and handlebars you should check out
#https://github.com/SlexAxton/require-handlebars-plugin
'hbs!modules/search/templates/SearchActivityFormTemplate'
#model dependencies
'modules/search/models/SearchRequest'
#autocomplete behavior for the locality field
'modules/core/behaviors/LocalityAutocompleteBehavior'
], ($, FormTemplate, SearchRequest, LocalityAutocompleteBehavior ) ->
#SearchFormView handles common stuff like searching upon 'enter' keyup,
#click on '.search', etc...
class SearchActivityFormView extends SearchFormView
template: FormTemplate
#I like to keep refs to the jQuery object my views use often
$term: undefined
$locality: undefined
initialize: ->
@render()
render: =>
#render the search form
@$el.html(@template())
#initialize the refs to the inputs we'll use later on
@$term = @$('input.term')
@$locality = @$('input.locality')
#Apply the locality autocomplete behavior to the form field 'locality'
LocalityAutocompleteBehavior.apply(@model, @$locality)
#return this view as a common practice to allow for chaining
@
search: =>
#A search is just an update to the 'query' attribute of the SearchRequest
#model which will perform a 'fetch' on 'change:query', and I have a result
#view using using the same model that will render on 'change:results'...
#I love Backbone :-D
@model.setQuery {term: @$term.val(), locality: @$locality.val()}