sferik/rails_admin — pull request #1149 by foohey (2012-05-20 01:34:10+00:00)
Title: added "change" triggers on filtering select's

I have two fields in a model. one of these is required.
so, i want to hide unneeded field by firing "change" event of select, but does not work with `select.html(option);` !

Here my UI logic
```coffeescript
$(document).ready ->
game_hidden = false
consoles_hidden = false

#
# First select
#
$("#actu_game_id").live 'change', (event,item) ->
if item
$("#actu_console_ids_field").hide('slow')
consoles_hidden = true
else
if consoles_hidden
$("#actu_console_ids_field").show('slow')
consoles_hidden = false

#
# Second (multi-select)
#
$("#actu_console_ids_field select.ra-multiselect-selection").live 'change', ->
options = $(this).find('option').size()
if (options > 0)
$("#actu_game_id_field").hide('slow')
game_hidden = true
else
if game_hidden
$("#actu_game_id_field").show('slow')
game_hidden = false
```
And if we add an item via single select then delete it, `
` element is still alive. I added `select.empty();` in the keyup