         url:        null     # url for remote connection
         selector:   null     # component target id
         data: []             # data for local connection
-        component:  "select" # type of component
         # Add a proxy
         # Proxy:
         #  url:    null

        url:       connect.target.url       || settings.target.url
        data:      connect.target.data      || settings.target.data
        selector:  connect.target.selector  || settings.target.selector
        component: connect.target.component || settings.target.component

      componentTarget = $("#{ target.selector }")

      if component.hasClass("selectpicker")
        component.on 'changed.bs.select', () ->

          if mode == "remote"
            $.ajax({ url: target.url, data: { id: component.val() }  }).done (data) ->
              updateTargetComponent(target, data, componentTarget)

          if mode == "local"
            data               = target.data || settings.target.data
            connect_option_id  = component.children("option:selected").val()
            data               = data.filter (value) ->
              return Number(value.connect_option_id) == Number(connect_option_id)

            updateTargetComponent(target, data, componentTarget)

      if component.hasClass("multi-column")
        component.multiSelect
          values: []
          afterSelect: (values) ->
            @options.values.push values[0]
            afterActionMultiColumn(this, mode, target, componentTarget)

          afterDeselect: (values) ->
            @options.values.splice($.inArray(values[0], @options.values), 1)
            afterActionMultiColumn(this, mode, target, componentTarget)

      if component.hasClass("select-field") or component.hasClass("input-refresh-button")
        component.on events, (e) ->
          e.preventDefault()
          componentTarget.empty()

          if mode == "remote"
            $.ajax({ url: target.url, data: { id: component.val() } }).done (data) ->
              updateTargetComponent(target, data, componentTarget)

          if mode == "local"
            data               = target.data || settings.target.data
            connect_option_id  = component.children("option:selected").val()
            data               = data.filter (value) ->
              return Number(value.connect_option_id) == Number(connect_option_id)

            updateTargetComponent(target, data, componentTarget)

)(jQuery)

    data.forEach (opt) ->
      componentTarget.append($("<option></option>").attr("value", opt.value).text(opt.text))

  updateTargetComponent = (data, componentTarget) ->
    updateOptionsHtml(data, componentTarget)
    componentTarget.multiSelect('refresh')  if componentTarget.hasClass('multi-column')
    componentTarget.selectpicker('refresh') if componentTarget.hasClass('selectpicker')
    componentTarget.multiselect('rebuild')  if componentTarget.hasClass('multi-select')

  $.fn.inputConnected = (options) ->

