Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. updateSelectizeOptions = (selectize) ->
  2.   currentValue = selectize.getValue()
  3.   options = getOptionsForColumn(selectize.$input.data('column'))
  4.   options.push(currentValue)
  5.   clearSelectizeOptions(selectize)
  6.   fillSelectizeWithOptions(selectize, options)
  7.   selectize.setValue(currentValue, true)
  8.  
  9. getOptionsForColumn = (column) =>
  10.   table = $('#changelog-report-table').DataTable()
  11.   dropdown_data = jQuery.unique(table.column(column).data()).sort()
  12.  
  13. clearSelectizeOptions = (selectize) =>
  14.   selectize.options = selectize.sifter.items = {}
  15.   selectize.clear(true)
  16.  
  17. fillSelectizeWithOptions = (selectize, options) =>
  18.   for value in options
  19.     selectize.addOption({ 'value': value })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement