         $(this).removeClass('checked').addClass('unchecked')
       else
         $(this).removeClass('unchecked').addClass('checked')
+      selector.trigger 'changed'
     record_td = $('<td></td>').addClass('selection').append(record_toggle)
     table.find('tbody tr').prepend record_td
 

  set: (path, value) -> @[path] = value
  get: (path) -> @[path]

  #selected_records: -> @table.find("td.selection input:checked").map( -> $(this).parents('tr').data('record') )
  selected_records: -> @table.find("td.selection .checked").map( -> $(this).parents('tr').data('record') )
  selected_ids: -> @selected_records().map( -> this.id ).toArray()
root = @
root.MultiSelect = new MultiSelect()
$.fn.multi_select = ->
  if @.hasClass('with-selection') or @.prop('tagName') is 'TABLE'
    select = new MultiSelect()
    root.MultiSelect = select
    select.setup @
  else
    @.find('table.with-selection').each (i, el)->
      select = new MultiSelect()
      root.MultiSelect = select
      select.setup $(el)
  select

      else
        table.find('td.selection .checker').removeClass('unchecked').addClass('checked')
        $(this).removeClass('unchecked').addClass('checked')
      selector.trigger 'changed'
    table.find('thead tr:last th:first').append toggle_all

    # Create a toggle/checkbox for all records and add it to the row
